- Home Startseite ホーム 主页 首頁
- SDK
- Dev Guide Handbuch Guía Guide Guida 開発ガイド 开发人员指南 開發指南
- Reference Referenz Referencia Référence Riferimento リファレンス 参考 參考資料
- Resources
- Videos ビデオ
- Blog ブログ 博客 網誌

Android.com

# Preparing to Publish: A Checklist

Publishing an application means testing it, packaging it appropriately, and making it available to users of Android-powered mobile devices.

If you plan to publish your application for installation on Android-powered devices, there are several things you need to do, to get your application ready. This document highlights the significant checkpoints for preparing your application for a successful release.

If you will publish your application on Android Market, please also see Publishing on Android Market for specific preparation requirements for your application.

For general information about the ways that you can publish an applications, see the Publishing Your Applications document.

Before you consider your application ready for release:

1. Test your application extensively on an actual device
2. Consider adding an End User License Agreement in your application
3. Consider adding licensing support
4. Specify an icon and label in the application's manifest
5. Turn off logging and debugging and clean up data/files

Before you do the final compile of your application:

6. Version your application
7. Obtain a suitable cryptographic key
8. Register for a Maps API Key, if your application is using MapView elements

Compile your application

After you compile your application:

9. Sign your application
10. Test your compiled application

## Before you consider your application ready for release

### 1. Test your application extensively on an actual device

It's important to test your application as extensively as possible, in as many areas as possible. To help you do that, Android provides a variety of testing classes and tools. You can use `Instrumentation` to run JUnit and other test cases, and you can use testing tools such as the UI/Application Exerciser Monkey.

- To ensure that your application will run properly for users, you should make every effort to obtain one or more physical mobile device(s) of the type on which you expect the application to run. You should then test your application on the actual device, under realistic network conditions. Testing your application on a physical device is very important, because it enables you to verify that your user interface elements are sized correctly (especially for touch-screen UI) and that your application's performance and battery efficiency are acceptable.
- If you can not obtain a mobile device of the type you are targeting for your application, you can use emulator options such as `-dpi`, `-device`, `-scale`, `-netspeed`, `-netdelay`, `-cpu-delay` and others to model the emulator's screen, network performance, and other attributes to match the target device to the greatest extent possible. You can then test your application's UI and performance. However, we strongly recommend that you test your application on an actual target device before publishing it.

### 2. Consider adding an End User License Agreement in your application

To protect your person, organization, and intellectual property, you may want to provide an End User License Agreement (EULA) with your application.

### 3. Consider adding support for Android Market Licensing

If you are publishing a paid application through Android Market, consider adding support for Android Market Licensing. Licensing lets you control access to your application based on whether the current user has purchased it. Using Android Market Licensing is optional.

For complete information about Android Market Licensing Service and how to use it in your application, see Licensing Your Applications.

### 4. Specify an icon and label in the application's manifest

The icon and label that you specify in an application's manifest are important because they are displayed to users as your application's icon and name. They are displayed on the device's Home screen, as well as in Manage Applications, My Downloads, and elsewhere. Additionally, publishing services may display the icon and label to users.

To specify an icon and label, you define the attributes `android:icon` and `android:label` in the `<application>` element of the manifest.

As regards the design of your icon, you should try to make it match as much as possible the style used by the built-in Android applications.

### 5. Turn off logging and debugging and clean up data/files

For release, you should make sure that debug facilities are turned off and that debug and other unnecessary data/files are removed from your application project.

- Remove the `android:debuggable="true"` attribute from the `<application>` element of the manifest.
- Remove log files, backup files, and other unnecessary files from the application project.
- Check for private or proprietary data and remove it as necessary.
- Deactivate any calls to `Log` methods in the source code.

## Before you do the final compile of your application

### 6. Version your application

Before you compile your application, you must make sure that you have defined a version number for your application, specifying an appropriate value for both the `android:versionCode` and `android:versionName` attributes of the `<manifest>` element in the application's manifest file. Carefully consider your version numbering plans in the context of your overall application upgrade strategy.

If you have previously released a version of your application, you must make sure to increment the version number of the current application. You must increment both the `android:versionCode` and `android:versionName` attributes of the `<manifest>` element in the application's manifest file, using appropriate values.

For detailed information about how to define version information for your application, see Versioning Your Applications.

### 7. Obtain a suitable cryptographic key

If you have read and followed all of the preparation steps up to this point, your application is compiled and ready for signing. Inside the .apk, the application is properly versioned, and you've cleaned out extra files and private data, as described above.

Before you sign your application, you need to make sure that you have a suitable private key. For complete information about how to obtain (or generate) a private key, see Obtaining a Suitable Private Key.

Once you have obtained (or generated) a suitable private key, you will use it to:

- Register for a Maps API Key (see below), if your application uses MapView elements.
- Sign your application for release, later in the preparation process

### 8. Register for a Maps API Key, if your application is using MapView elements

For complete information about getting a Maps API Key, see Obtaining a Maps API Key.

If your application uses one or more Mapview elements, you will need to register your application with the Google Maps service and obtain a Maps API Key, before your MapView(s) will be able to retrieve data from Google Maps. To do so, you supply an MD5 fingerprint of your signer certificate to the Maps service.

During development, you can get a temporary Maps API Key by registering the debug key generated by the SDK tools. However, before publishing your application, you must register for a new Maps API Key that is based on your private key.

If your application uses MapView elements, the important points to understand are:

1. You must obtain the Maps API Key before you compile your application for release, because you must add the Key to a special attribute in each MapView element — `android:apiKey` — in your application's layout files. If you are instantiating MapView objects directly from code, you must pass the Maps API Key as a parameter in the constructor.
2. The Maps API Key referenced by your application's MapView elements must be registered (in Google Maps) to the certificate used to sign the application. This is particularly important when publishing your application — your MapView elements must reference a Key that is registered to the release certificate that you will use to sign your application.
3. If you previously got a temporary Maps API Key by registering the debug certificate generated by the SDK tools, you must remember to obtain a new Maps API Key by registering your release certificate. You must then remember to change the MapView elements to reference the new Key, rather than the Key associated with the debug certificate. If you do not do so, your MapView elements will not have permission to download Maps data.
4. If you change the private key that you will use to sign your application, you must remember to obtain a new Maps API Key from the Google Maps service. If you do not get a new Maps API Key and apply it to all MapView elements, any MapView elements referencing the old Key will not have permission to download Maps data.

## Compile your application

When you've prepared your application as described in the previous sections, you can compile your application for release.

## After you compile your application

### 9. Sign your application

Sign your application using your private key and then align it with the `zipalign` tool. Signing your application correctly is critically important. Please see Signing Your Applications for complete information.

### 10. Test your compiled and signed application

Before you release your compiled application, you should thoroughly test it on the target mobile device (and target network, if possible). In particular, you should make sure that any MapView elements in your UI are receiving maps data properly. If they are not, go back to Register for a Maps API Key and correct the problem. You should also ensure that the application works correctly with any server-side services and data that you are providing or are relying on and that the application handles any authentication requirements correctly.

After testing, you are now ready to publish your application to mobile device users.

↑ Go to top