Join David Gassner for an in-depth discussion in this video Packaging an Android app, part of Distributing Android Apps.
- After developing and testing your Android app the final step is packaging. When you package an Android app you create an APK file. The APK is a ZIP archive that has compressed folders and files that make up your app. The APK is 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 nearly all 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 describes the app's version, capabilities and permissions, and it'll have a Signed certificate that verifies your identity as the developer. It'll have the proper code for the version of the Android SDK that you targeted when you compiled the app. This is known as the Platform code. And it'll also include your custom Compiled classes, which are the logic of your application in a special format.
It'll have the app's resources, graphics and other files which can either be compiled or not compiled, and also uncompiled assets. All of these files and folders are compressed during the packaging process into the single APK file. And then your job is to get that APK file to your users so they can run the app on their devices. There are a few different way of doing this. One approach is to use the process called Side-Loading. This means that you bypass the Google Play store and any of the other common app distribution channels and simply send the APK file to your users.
You can transfer the file through conventional means, using email, file-sharing systems, letting them download it from a website or other approaches. Contemporary Android devices have a security setting that by default doesn't let the user do this, 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 they've modified the setting, they can simply open the APK file, and confirm that they want the app, and the app will be installed.
For commercial distribution, of course, you'll want to use the app stores. Google Play, Amazon, Barnes and Noble's Nook store, and others. To distribute your app through these stores, you'll need to create some marketing images and descriptive text but then once the app has been accepted and published the app store's 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 after they take their cut.
You can package your app either from the command line, or for simplicity, do it through an integrated development environment. In this course, my focus will be on packaging an app in Android Studio. I'll show you how to create the signed certificate to verify your developer identity to the users and the app stores. This signed certificate requires something called a keystore file. You're using a keystore file all the time when you test an app. It's a debug version of a keystore file that's generated automatically, and is unique to your development system.
But the keystore you use to create a signed APK file must be a release version. You can't use the debug keystore for that purpose. So that's the basic process. You build and test your app, you create your release keystore file and your signed certificate, and then 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 of those steps in detail in the rest of this course.
- Packaging an Android app
- Distributing through Google vs. Amazon and other app stores
- Generating a signed APK file
- Testing the app
- Protecting an app with ProGuard
- Registering and publishing apps with Google Play
- Adding in-app products
- Tracking app usage and revenue in Google Play
- Submitting an app to Amazon