Configuring your application for release
- At a minimum you need to remove
Log
calls and remove theandroid:debuggable
attribute from your manifest file. - You should also provide values for the
android:versionCode
andandroid:versionName
attributes, which are located in the<manifest>
element. - Building and signing a release version of your application.
- Testing the release version of your application.
- Updating application resources for release.
- Preparing remote servers and services that your application depends on.
Releasing Your Application to Users
- Releasing through an App Marketplace
- Releasing your application through email
- Releasing through a web site
- User Opt-In for Apps from Unknown Sources
Gathering Materials and Resources
- Cryptographic keys
- Application Icon
- End-user License Agreement
- Miscellaneous Materials
Configuring Your Application for Release
- Choose a good package name
- Turn off logging and debugging
- Clean up your project directories
- Review and update your manifest and Gradle build settings
<uses-permission>
elementandroid:icon
andandroid:label
attributesandroid:versionCode
andandroid:versionName
attributes
Address compatibility issues
- Add support for multiple screen configurations
- Optimize your application for Android tablet devices
- Consider using the Support Library
Update URLs for servers and services
Implement Licensing (if you are releasing on Google Play)
Building Your Application for Release
- Building with Android Studio
Preparing External Servers and Resources
Testing Your Application for Release
Setting Application Version
android:versionCode
— An integer value that represents the version of the application code, relative to other versions.- You can set the value to any integer you want, however you should make sure that each successive release of your application uses a greater value.
- The
android:versionCode
value does not necessarily have a strong resemblance to the application release version that is visible to the user. - The greatest possible value for android:versionCode is MAXINT (2147483647). However, if you upload an app with this value, your app can't ever be updated.
android:versionName
— A string value that represents the release version of the application code, as it should be shown to users.- The value is a string so that you can describe the application version as a
<major>.<minor>.<point>
string, or as any other type of absolute or relative version identifier.
- The value is a string so that you can describe the application version as a
You define both of these version attributes in the <manifest>
element of the manifest file or the Gradle
build file.
MAJOR - Make incompatible API changes MINOR - Add functionality in backwards-compatible manner PATCH - Make backwards-compatible bug fixes
Example:
- 1.0.0-SNAPSHOT - development phase or pre-alpha or nightly builds
- 1.0.0-alpha - developers generally test the software using white-box techniques
- 1.0.0-a
- 1.0.0-alpha.1
- 1.0.0-a1
- 1.0.0-beta - beta phase generally begins when the software is feature complete but likely to contain a number of known or unknown bugs. The first time that the software is available outside of the organization that developed it.
- 1.0.0-b
- 1.0.0-beta.1
- 1.0.0-b1
- 1.0.0-rc - is a beta version with potential to be a final product, which is ready to release unless significant bugs emerge.
- 1.0.0-rc.1
- 1.0.0 - Once released, the software is generally known as a "stable release".
NOTE:
- If you use the Google Play Alpha/Beta Testing program take into account that it’s not a good idea to upload an APK with a version name ending in “alpha” or “beta”.
- The reason is that when you promote an APK to production, you are not able to change the version name, so your users are going to believe they have installed a non stable version.
versionCode
- 1.0.0-SNAPSHOT - 01 00 00 00
- 1.0.0-RC* - 01 00 00 01 ... 01 00 00 98
- 1.0.0 - 01 00 00 99
The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.
Specifying Your Application's System API Requirements
android:minSdkVersion
— The minimum version of the Android platform on which the application will run, specified by the platform's API Level identifier.android:targetSdkVersion
— Specifies the API Level on which the application is designed to run. In some cases, this allows the application to use manifest elements or behaviors defined in the target API Level, rather than being restricted to using only those defined for the minimum API Level.android:maxSdkVersion
— The maximum version of the Android platform on which the application is designed to run, specified by the platform's API Level identifier. Important: Please read the documentation before using this attribute.
- https://developer.android.com/studio/publish/index.html
- https://developer.android.com/studio/publish/preparing.html
- https://developer.android.com/studio/publish/versioning.html
- https://developer.android.com/studio/publish/app-signing.html
- https://developer.android.com/studio/run/index.html
- https://developer.android.com/distribute/tools/launch-checklist.html
- https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html
- https://www.jayway.com/2015/03/11/automatic-versioncode-generation-in-android-gradle/
- https://medium.com/@maxirosson/versioning-android-apps-d6ec171cfd82#.g1etlnuyk
- https://www.digitalocean.com/community/tutorials/java-keytool-essentials-working-with-java-keystores