Join David Gassner for an in-depth discussion in this video Packaging an Android app, part of Distributing Android Apps (2014).
The final step in building an Android app is packing it for distribution to your users. When you package an Android app, you end up creating something called an APK file. The APK is a ZIP archive, that compresses all the folders and files that make up your app. The ZIP archive is then copied to Android devices either directly or through an App Store. Android apps that only use the Android SDK and don't have any native code can be installed on most Android devices including cell phones, tablets and hybrid devices.
An Android app contains many different files and folders. It'll have an app manifest. The XML file that subscribes to contents and version of the app. It'll have a signed certificate that verifies your identity as the developer. It'll have the code for the version of the Android SDK that you used to compile the app. This is known as the platform code and it'll have your custom compiled classes which are the logic of your application. It'll contain the resources, graphics and other files which can either be compiled or not compiled.
All of these files and folders are collapsed together during the packaging process into the single APK file. And then your job is to get that APK file to your users so that they can run the app on their devices. There are a few different ways of doing this. One approach, is to use a process called Side-Loading. This means that you bypass the Google Play store and any of the other approved app distribution channels and simply send the APK file to your users.
You can transfer the file through a conventional means, using email, file-sharing, letting them download it from a website and other approaches. Most Android devices have a security setting that doesn't let the user do this by default, but I'll show you how they can turn that feature off and allow installation of apps from somewhere known as an unknown source, that's you. Once you transfer the file and they've set that setting, they can simply open the APK file and the app will be installed.
It's that easy, but for commercial distribution, you'll want to use the App Stores. You'll take the APK file and create some marketing images and descriptive text. And you'll upload it to one or more of the App Stores, Google Play, Amazon's App Store, Barnes and Noble's Nook Store or others. And through this process, the users will be able to discover and install your app. If your app has a price on it, that is if you want your users to pay for it.
They'll send their payment through the App Store. And then you'll receive payment from the App Store vendor. You can package your app either from the command line or for simplicity, do it through the integrated development environment. In this course, my focus will be on Eclipse with the Android Developer Tools or ADT. I'll show you how to create a signed certificate, to verify your developer identity, to either the users or the App Stores.
The signed certificate requires something called a keystore file and it needs to be a released version of the keystore file. And not the debug key store that's created automatically when you're creating testing and debugging your app. If your working with an Eclipse, you can simply start the process by going to the menu and selecting File>Export>Android>Export Android Application, and you'll follow the prompts. I'll show you the steps during this course.
So that's the basic process. You build and test your app, you create your release keystore file and create your signed certificate and then using your app and the certificate, you package the app. You then distribute the resulting APK file to your users either directly through side-loading or through one or more of the App Stores. And I'll show you all those steps in detail in the rest of this course.
- Packaging an Android app
- Distributing through Google vs. Amazon vs. Barnes & Noble
- Exporting the APK file
- Testing the app
- Shrinking and protecting an app with ProGuard
- Creating and uploading screenshots to Google Play
- Adding in-app products
- Tracking app usage and revenue