Home | History | Annotate | Download | only in publishing
      1 page.title=Preparing to Publish: A Checklist
      2 @jd:body
      3 
      4 <!--
      5 <div id="qv-wrapper">
      6 <div id="qv">
      7 
      8 <h2>In this document</h2>
      9 
     10 <ol>
     11 <li><a href=""></a></li>
     12 </ol>
     13 
     14 </div>
     15 </div>
     16 -->
     17 
     18 <p>Publishing an application means testing it, packaging it appropriately, and 
     19 making it available to users of Android-powered mobile devices.</p>
     20 
     21 <p>If you plan to publish your application for installation on
     22 Android-powered devices, there are several things you need to do, to get
     23 your application ready. This document highlights the significant
     24 checkpoints for preparing your application for a successful release.
     25 </p>
     26 
     27 <p>If you will publish your application on Android Market, please also see <a
     28 href="{@docRoot}guide/publishing/publishing.html#market">Publishing on Android Market</a> 
     29 for specific preparation requirements for your application. </p>
     30 
     31 <p>For general information about the ways that you can publish an applications, 
     32 see the <a href="{@docRoot}guide/publishing/publishing.html">Publishing Your 
     33 Applications</a> document. </p>
     34 
     35 <div class="special">
     36 
     37 <p>Before you consider your application ready for release:</p>
     38 
     39 <ol>
     40 <li>Test your application extensively on an actual device </li>
     41 <li>Consider adding an End User License Agreement in your application</li>
     42 <li>Specify an icon and label in the application's manifest</li>
     43 <li>Turn off logging and debugging and clean up data/files</li>
     44 </ol>
     45 
     46 <p>Before you do the final compile of your application:</p>
     47 
     48 <ol start="5">
     49 <li>Version your application</li>
     50 <li>Obtain a suitable cryptographic key</li>
     51 <li>Register for a Maps API Key, if your application is using MapView elements</li>
     52 </ol>
     53 
     54 <p><em>Compile your application...</em></p>
     55 <p>After compiling your application:</p>
     56 <ol start="8">
     57 <li>Sign your application</li>
     58 <li>Test your compiled application</li>
     59 </ol>
     60 </div>
     61 
     62 <h2 id="releaseready">Before you consider your application ready for release</h2>
     63 
     64 <h3 id="test">1. Test your application extensively on an actual device</h3>
     65 
     66 <p>It's important to test your application as extensively as possible, in as
     67 many areas as possible. To help you do that, Android provides a variety of
     68 testing classes and tools. You can use 
     69 {@link android.app.Instrumentation Instrumentation} to run JUnit and other 
     70 test cases, and you can use testing
     71 tools such as the <a href="{@docRoot}guide/developing/tools/monkey.html">UI/Application
     72 Exerciser Monkey</a>.  </p>
     73 
     74 <ul>
     75 <li>To ensure that your application will run properly for users, you should make
     76 every effort to obtain one or more physical mobile device(s) of the type on
     77 which you expect the application to run. You should then test your application
     78 on the actual device, under realistic network conditions. Testing  your
     79 application on a physical device is very important, because it enables you to
     80 verify that your user interface elements are sized correctly (especially for
     81 touch-screen UI) and that your application's performance and battery efficiency
     82 are acceptable.</li>
     83 
     84 <li>If you can not obtain a mobile device of the type you are targeting for your
     85 application, you can use emulator options such as <code>-dpi</code>,
     86 <code>-device</code>, <code>-scale</code>, <code>-netspeed</code>,
     87 <code>-netdelay</code>, <code>-cpu-delay</code> and others to model the
     88 emulator's screen, network performance, and other attributes to match the target
     89 device to the greatest extent possible. You can then test your application's UI
     90 and performance. However, we strongly recommend that you test your application
     91 on an actual target device before publishing it. </li>
     92 
     93 <li>If you are targeting the <a href="http://www.t-mobileg1.com/">T-Mobile
     94 G1</a> device for your application, make sure that your UI handles screen
     95 orientation changes. </li>
     96 </ul>
     97 
     98 <h3 id="eula">2. Consider adding an End User License Agreement in your 
     99 application</h3>
    100 
    101 <p>To protect your person, organization, and intellectual property, you may want
    102 to provide an End User License Agreement (EULA) with your application. 
    103 
    104 <h3 id="iconlabel">3. Specify an icon and label in the application's manifest</h3>
    105 
    106 <p>The icon and label that you specify in an application's manifest are
    107 important because they are displayed to users as your application's icon and
    108 name. They are displayed on the device's Home screen, as well as in Manage
    109 Applications, My Downloads, and elsewhere. Additionally, publishing services may
    110 display the icon and label to users. </p>
    111 
    112 <p>To specify an icon and label, you define the attributes
    113 <code>android:icon</code> and <code>android:label</code> in the 
    114 <code>&lt;application&gt;</code> element of the manifest. </p>
    115 
    116 <p>As regards the design of your icon, you should try to make it match as much
    117 as possible the style used by the built-in Android applications.</p>
    118 
    119 <h3 id="logging">4. Turn off logging and debugging and clean up data/files</h3>
    120 
    121 <p>For release, you should make sure that debug facilities are turned off and
    122 that debug and other unnecessary data/files are removed from your application
    123 project.</p>
    124 <ul>
    125 <li>Remove the <code>android:debuggable="true"</code> attribute from the
    126 <code>&lt;application&gt;</code> element of the manifest.</li>
    127 <li>Remove log files, backup files, and other unnecessary files from the
    128 application project.</li>
    129 <li>Check for private or proprietary data and remove it as necessary.</li>
    130 <li>Deactivate any calls to {@link android.util.Log} methods in the source
    131 code.</li>
    132 </ul>
    133 
    134 <h2 id="finalcompile">Before you do the final compile of your application</h2>
    135 
    136 <h3 id="versionapp">5. Version your application</h3>
    137 
    138 <p>Before you compile your application, you must make sure that you have defined
    139 a version number for your application, specifying an appropriate value for both
    140 the <code>android:versionCode</code> and <code>android:versionName</code>
    141 attributes of the <code>&lt;manifest&gt;</code> element in the application's
    142 manifest file. Carefully consider your version numbering plans in the context of
    143 your overall application upgrade strategy. </p>
    144 
    145 <p>If you have previously released a version of your application, you must make
    146 sure to increment the version number of the current application. You must
    147 increment both the <code>android:versionCode</code> and
    148 <code>android:versionName</code> attributes of the <code>&lt;manifest&gt;</code>
    149 element in the application's manifest file, using appropriate values. </p>
    150 
    151 <p>For detailed information about how to define version information for your
    152 application, see <a href="{@docRoot}guide/publishing/versioning.html">Versioning 
    153 Your Applications</a>.</p>
    154 
    155 <h3 id="cryptokey">6. Obtain a suitable cryptographic key</h3>
    156 
    157 <p>If you have read and followed all of the preparation steps up to this point,
    158 your application is compiled and ready for signing. Inside the .apk, the
    159 application is properly versioned, and you've cleaned out extra files and
    160 private data, as described above. </p>
    161 
    162 <p>Before you sign your application, you need to make sure that you have a
    163 suitable private key. For complete information about how to obtain (or generate)
    164 a private key, see <a href="{@docRoot}guide/publishing/app-signing.html#cert">
    165 Obtaining a Suitable Private Key</a>.</p>
    166 
    167 <p>Once you have obtained (or generated) a suitable private key, you will use it
    168 to:</p>
    169 
    170 <ul>
    171 <li>Register for a Maps API Key (see below), if your application uses MapView
    172 elements.</li>
    173 <li>Sign your application for release, later in the preparation process</li>
    174 </ul>
    175 
    176 <h3 id="mapsApiKey">7. Register for a Maps API Key, if your application is using
    177 MapView elements</h3>
    178 
    179 <div class="sidebox-wrapper">
    180 <div class="sidebox"><p>
    181 For complete information about getting a Maps API Key, see <a
    182 href="http://code.google.com/android/add-ons/google-apis/mapkey.html">
    183 Obtaining a Maps API Key</a>.</p>
    184 </div>
    185 </div>
    186 
    187 <p>If your application uses one or more Mapview elements, you will need to 
    188 register your application with the Google
    189 Maps service and obtain a Maps API Key, before your MapView(s) will be able to
    190 retrieve data from Google Maps. To do so, you supply an MD5 fingerprint of your
    191 signer certificate to the Maps service. </p>
    192 
    193 <p>During development, you can get a temporary Maps API Key by registering the
    194 debug key generated by the SDK tools. However, before publishing your
    195 application, you must register for a new Maps API Key that is based on your
    196 private key. </p>
    197 
    198 <p>If your application uses MapView elements, the important points to understand
    199 are:</p>
    200 
    201 <ol>
    202 <li>You <em>must</em> obtain the Maps API Key before you compile your
    203 application for release, because you must add the Key to a special attribute in
    204 each MapView element &mdash; <code>android:apiKey</code> &mdash; in your
    205 application's layout files. If you are instantiating MapView objects directly
    206 from code, you must pass the Maps API Key as a parameter in the constructor.
    207 </li>
    208 <li>The Maps API Key referenced by your application's MapView elements must be
    209 registered (in Google Maps) to the certificate used to sign the application.
    210 This is particularly important when publishing your application &mdash; your
    211 MapView elements must reference a Key that is registered to the release
    212 certificate that you will use to sign your application.  </li>
    213 <li>If you previously got a temporary Maps API Key by registering the debug
    214 certificate generated by the SDK tools, you <em>must</em> remember to obtain a
    215 new Maps API Key by registering your release certificate. You must then remember
    216 to change the MapView elements to reference the new Key, rather than the Key
    217 associated with the debug certificate. If you do not do so, your MapView
    218 elements will not have permission to download Maps data. </li>
    219 <li>If you change the private key that you will use to sign your application,
    220 you <em>must</em> remember to obtain a new Maps API Key from the Google Maps
    221 service. If you do not get a new Maps API Key and apply it to all MapView
    222 elements, any MapView elements referencing the old Key will not have permission
    223 to download Maps data. </li>
    224 </ol>
    225 
    226 <h2 id="compile">Compile your application</h2>
    227 
    228 <p>When you've prepared your application as described in the previous sections,
    229 you can compile your application for release.</p>
    230 
    231 
    232 <h2 id="post-compile">After compiling your application</h2>
    233 
    234 <h3 id="signapp">8. Sign your application</h3>
    235 
    236 <p>Sign your application using your private key and then
    237 align it with the {@code zipalign} tool. Signing your application
    238 correctly is critically important. Please see
    239 <a href="{@docRoot}guide/publishing/app-signing.html">Signing Your 
    240 Applications</a> for complete information. </p>
    241 
    242 <h3 id="testapp">9. Test your compiled and signed application</h3>
    243 
    244 <p>Before you release your compiled application, you should thoroughly test it
    245 on the target mobile device (and target network, if possible). In particular,
    246 you should make sure that any MapView elements in your UI are receiving maps
    247 data properly. If they are not, go back to <a href="#mapsApiKey">Register for a
    248 Maps API Key</a> and correct the problem. You should also ensure that the
    249 application works correctly with any server-side services and data that you are
    250 providing or are relying on and that the application handles any authentication
    251 requirements correctly.  </p>
    252 
    253 <p>After testing, you are now ready to publish your application to mobile device
    254 users.</p>
    255 
    256 
    257