1 page.title=Publishing on Android Market 2 @jd:body 3 4 <div id="qv-wrapper"> 5 <div id="qv"> 6 7 <h2>Quickview</h2> 8 9 <ul> 10 <li>You can publish your application using a hosted service such as Android Market or through a web server.</li> 11 <li>Before you publish, make sure you have prepared your application properly.</li> 12 <li>Android Market makes it easy for users of Android-powered devices to see and download your application.</li> 13 </ul> 14 15 16 <h2>In this document</h2> 17 18 <ol> 19 <li><a href="#overview">About Android Market</a> 20 <li><a href="#marketupgrade">Publishing Updates on Android Market</a></li> 21 <li><a href="#marketLicensing">Using Android Market Licensing Service</a></li> 22 <li><a href="#marketintent">Linking to Your Apps on Android Market</a> 23 <ol> 24 <li><a href="#OpeningDetails">Opening an app's details page</a></li> 25 <li><a href="#PerformingSearch">Performing a search</a></li> 26 <li><a href="#BuildaButton">Build an Android Market button</a></li> 27 <li><a href="#UriSummary">Summary of URI formats</a></li> 28 </ol> 29 </li> 30 </ol> 31 32 <h2>See also</h2> 33 34 <ol> 35 <li><a href="{@docRoot}guide/publishing/licensing.html">Application Licensing</a></li> 36 <li><a href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a></li> 37 </ol> 38 39 <div id="qv-extra"> 40 <img id="rule" src="{@docRoot}assets/images/grad-rule-qv.png"> 41 <div id="qv-sub-rule"> 42 <img src="{@docRoot}assets/images/icon_market.jpg" style="float:left;margin:0;padding:0 5px;"> 43 <h2 style="color:#669999;">Interested in publishing your app on Android Market?</h2> 44 <p><a href="http://market.android.com/publish">Go to Android Market</a> to 45 create a developer account and upload your application. For more information about the 46 required assets, listing details, and options, see <a 47 href="http://market.android.com/support/bin/answer.py?answer=113469">Uploading 48 applications</a>.</p> 49 </div> 50 </div> 51 52 </div> 53 </div> 54 55 <p>If you've followed the steps outlined in <a 56 href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a>, the result of the process 57 is a compiled {@code .apk} file that is signed with your private release key. Your application is 58 now ready to be published publicly so users can install it.</p> 59 60 <p>You can publish your application and allow users to install it any way you choose, including 61 from your own web server. This document provides information about publishing your Android 62 application with Android Market.</p> 63 64 65 <h2 id="overview">About Android Market</h2> 66 67 <p>Android Market is a service that makes it easy for users to find and download Android 68 applications to their Android-powered devices, either from the Android Market application on their 69 device or from the Android Market web site (<a 70 href="http://market.android.com">market.android.com</a>). As a developer, you can use Android Market 71 to distribute your applications to users on all types of Android-powered devices, all around the 72 world.</p> 73 74 <p>To publish your application on Android Market, you first need to register 75 with the service using a Google account and agree to the terms of service. 76 Once you are registered, you can upload your application to the service whenever 77 you want, update it as many times as you want, and then publish it when you are ready. 78 Once published, users can see your application, download it, and rate it. </p> 79 80 <p>To register as an Android Market developer and get started with publishing, 81 visit the Android Market publisher site: </p> 82 83 <p style="margin-left:3em;"><a 84 href="http://market.android.com/publish">http://market.android.com/publish</a> 85 </p> 86 87 <p>If you plan to publish your application on Android Market, you must make sure 88 that it meets the requirements listed below, which are enforced by the Market 89 server when you upload the application.</p> 90 91 <div class="special"> 92 <p>Requirements enforced by the Android Market server:</p> 93 <ol> 94 <li>Your application must be signed with a cryptographic private key whose 95 validity period ends after <span style="color:red">22 October 2033</span>. </li> 96 <li>Your application must define both an <code>android:versionCode</code> and an 97 <code>android:versionName</code> attribute in the 98 <a 99 href="{@docRoot}guide/topics/manifest/manifest-element.html"><code><manifest></code></a> 100 element of its manifest file. The server uses the <code>android:versionCode</code> as 101 the basis for identifying the application internally and handling updates, and 102 it displays the <code>android:versionName</code> to users as the application's 103 version.</li> 104 <li>Your application must define both an <code>android:icon</code> and an 105 <code>android:label</code> attribute in the <a 106 href="{@docRoot}guide/topics/manifest/application-element.html"><code><application></code></a> 107 element of its manifest file.</li> 108 </ol> 109 </div> 110 111 112 <h2 id="marketupgrade">Publishing Updates on Android Market</h2> 113 114 <p>At any time after publishing an application on Android Market, you can upload 115 and publish an update to the same application package. When you publish an 116 update to an application, users who have already installed the 117 application may receive a notification that an update is 118 available for the application. They can then choose to update the application 119 to the latest version.</p> 120 121 <p>Before uploading the updated application, be sure that you have incremented 122 the <code>android:versionCode</code> and <code>android:versionName</code> 123 attributes in the <a 124 href="{@docRoot}guide/topics/manifest/manifest-element.html"><code><manifest></code></a> 125 element of the manifest file. Also, the package name must be the same as the existing version and 126 the {@code .apk} file must be signed with the same private key. If the package name and signing 127 certificate do <em>not</em> match those of the existing version, Market will 128 consider it a new application, publish it as such, and will not offer it to existing users as an 129 update.</p> 130 131 132 <h2 id="marketLicensing">Using Android Market Licensing Service</h2> 133 134 <p>Android Market offers a licensing service that lets you enforce licensing 135 policies for paid applications that you publish through Android Market. With 136 Android Market Licensing, your applications can query Android Market at runtime 137 to obtain the licensing status for the current user, then allow or disallow 138 further use of the application as appropriate. Using the service, you can apply a flexible 139 licensing policy on an application-by-application basis—each 140 application can enforce its licensing status in the way most appropriate 141 for it. </p> 142 143 <p>Any application that you publish through Android Market can use the Android 144 Market Licensing Service. The service uses no dedicated framework APIs, so you can 145 add licensing to any application that uses a minimum API Level of 3 or 146 higher.</p> 147 148 <p>For complete information about Android Market Licensing Service and how to 149 use it in your application, read <a 150 href="{@docRoot}guide/publishing/licensing.html">Application Licensing</a>.</p> 151 152 153 154 <h2 id="marketintent">Linking to Your Apps on Android Market</h2> 155 156 <p>To help users discover your published applications, you can use two special Android Market URIs 157 that direct users to your application's details page or perform a search for all of your published 158 applications in Android Market. You can use these URIs to create a button in your application or a 159 link on a web page that:</p> 160 161 <ul> 162 <li>Opens your application's details page in the Android Market application or web site.</li> 163 <li>Searches for all your published applications in the Android Market application or web 164 site.</li> 165 </ul> 166 167 <p>You can launch the Android Market application or web site in the following ways:</p> 168 <ul> 169 <li>Initiate an {@link android.content.Intent} from your application that launches the 170 Android Market application on the user's device.</li> 171 <li>Provide a link on a web page that opens the Android Market web site (but will also 172 open the Android Market application if clicked from a device).</li> 173 </ul> 174 175 <p>In both cases, whether you want to initiate the action from your application or from a web 176 page, the URIs are quite similar. The only difference is the URI prefix.</p> 177 178 <p>To open the Android Market application from your application, the prefix for the intent's data 179 URI is:</p> 180 181 <p style="margin-left:2em"><code>market://</code></p> 182 183 <p>To open Android Market from your web site, the prefix for the link URI is:</p> 184 185 <p style="margin-left:2em"><code>http://market.android.com/</code></p> 186 187 <p>The following sections describe how to create a complete URI for each action.</p> 188 189 <p class="note"><strong>Note:</strong> If you create a link to open Android Market from your web 190 site and the user selects it from an Android-powered device, the device's Market application will 191 resolve the link so the user can use the Market application instead of opening the web 192 site. As such, you should always use {@code http://market.android.com/} URIs when creating a link on 193 a web page. When pointing to your apps from within your Android app, use the 194 {@code market://} URIs in an intent, so that the Market application always opens.</p> 195 196 197 <h3 id="OpeningDetails">Opening an app's details page</h3> 198 199 <p>As described above, you can open the details page for a specific application either on the 200 Android Market application or the Android Market web site. The details page allows the user to see 201 the application description, screenshots, reviews and more, and choose to install it.</p> 202 203 <p>The format for the URI that opens the details page is:</p> 204 205 <p style="margin-left:2em"><code><URI_prefix><b>details?id=</b><package_name></code></p> 206 207 <p>The <code><package_name></code> is a placeholder for the target application's 208 fully-qualified package name, as declared in the <a 209 href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code 210 package}</a> attribute of the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code 211 <manifest>}</a> element.</p> 212 213 214 <h4>Opening the app details page from your Android app</h4> 215 216 <p>To open the Android Market details page from your application, 217 create an intent with the {@link android.content.Intent#ACTION_VIEW} action and include a data URI 218 in this format:</p> 219 220 <p style="margin-left:2em"><code>market://details?id=<package_name></code></p> 221 222 <p>For example, here's how you can create an intent and open an application's details page in 223 Android Market:</p> 224 225 <pre> 226 Intent intent = new Intent(Intent.ACTION_VIEW); 227 intent.setData(Uri.parse("market://details?id=com.android.example")); 228 startActivity(intent); 229 </pre> 230 231 <p>This will open the Android Market application on the device to view the {@code 232 com.android.example} application.</p> 233 234 235 <h4>Opening the app details page from a web site</h4> 236 237 <p>To open the details page from your web site, create a link with a URI in this 238 format:</p> 239 240 <p style="margin-left:2em"> 241 <code>http://market.android.com/details?id=<package_name></code> 242 </p> 243 244 <p>For example, here's a link that opens an application's details page on Android Market:</p> 245 246 <pre> 247 <a href="http://market.android.com/details?id=com.android.example">App Link</a> 248 </pre> 249 250 <p>When clicked from a desktop web browser, this opens the Android Market web site to view the 251 {@code com.android.example} application. When clicked from an Android-powered device, users are 252 given the option to use either their web browser or the Android Market application to view the 253 application.</p> 254 255 256 257 <h3 id="PerformingSearch">Performing a search</h3> 258 259 <p>To initiate a search in Android Market, the format for the URI is:</p> 260 261 <p style="margin-left:2em"> 262 <code><URI_prefix><b>search?q=</b><query></code> 263 </p> 264 265 <p>The <code><query></code> is a placeholder for the search query to execute in Android 266 Market. The query can be a raw text string or you can include a parameter that performs a search 267 based on the publisher name:</p> 268 269 <ul> 270 <li>To perform a raw text search, append the query string: 271 <p><code><URI_prefix><b>search?q=</b><search_query></code></p></li> 272 273 <li>To search based on the publisher name, use the {@code pub:} parameter in the query, followed 274 by the publisher name: 275 <p><code><URI_prefix><b>search?q=pub:</b><publisher_name></code></p> 276 <p>You can use this type of search to show all of your published applications.</p></li> 277 </ul> 278 279 280 <h4>Searching from your Android app</h4> 281 282 <p>To initiate a search on Android Market from your application, create an intent with the 283 {@link android.content.Intent#ACTION_VIEW} action and include a data URI in this format:</p> 284 285 <p style="margin-left:2em"><code>market://search?q=<query></code></p> 286 287 <p>The query may include the {@code pub:} parameter described above.</p> 288 289 <p>For example, here's how you can initiate a search in the Android Market application, based on the 290 publisher name:</p> 291 292 <pre> 293 Intent intent = new Intent(Intent.ACTION_VIEW); 294 intent.setData(Uri.parse("market://search?q=pub:Your Publisher Name")); 295 startActivity(intent); 296 </pre> 297 298 <p>This opens the Android Market application to perform the search. The search result shows all 299 applications published by the publisher that are compatible with the current device.</p> 300 301 302 <h4>Searching from a web site</h4> 303 304 <p>To initiate a search on Android Market from your web site, create a link with a URI in this 305 format:</p> 306 307 <p style="margin-left:2em"> 308 <code>http://market.android.com/search?q=<query></code> 309 </p> 310 311 <p>The query may include the {@code pub:} parameter described above.</p> 312 313 <p>For example, here's a link that initiates a search on Android Market, based on the 314 publisher name:</p> 315 316 <pre> 317 <a href="http://market.android.com/search?q=pub:Your Publisher Name">Search Link</a> 318 </pre> 319 320 <p>When clicked from a desktop web browser, this opens the Android Market web site and performs the 321 search. When clicked from an Android-powered device, users are given the option to use either their 322 web browser or the Android Market application to perform the search.</p> 323 324 325 326 <h3 id="BuildaButton">Build an Android Market button</h3> 327 328 <p>Use the following form to generate an "Available in Android Market" button that you can use on 329 your web site. Input either your application's package name or publisher name and the button will 330 take users to Android Market to either view your application's information or view a list of 331 your published apps. If users click the button while on an Android-powered device, the Android 332 Market application will respond to show users your application(s).</p> 333 334 <p>This form offers four versions of the official "Available in Android Market" button at 335 recommended sizes. If you want to create a different size, you can download an EPS file for 336 the button images from the <a href="http://www.android.com/branding.html">Android Brand 337 Guidelines</a>.</p> 338 339 <style type="text/css"> 340 341 form.button-form { 342 margin-top:2em; 343 } 344 345 /* the label and input elements are blocks that float left in order to 346 keep the left edgets of the input aligned, and IE 6/7 do not fully support "inline-block" */ 347 label.block { 348 display: block; 349 float: left; 350 width: 100px; 351 padding-right: 10px; 352 } 353 354 input.text { 355 display: block; 356 float: left; 357 width: 250px; 358 } 359 360 div.button-row { 361 white-space:nowrap; 362 min-height:80px; 363 } 364 365 div.button-row input { 366 vertical-align:120%; 367 } 368 369 #jd-content div.button-row img { 370 margin: 0; 371 } 372 373 </style> 374 375 <script type="text/javascript"> 376 377 // variables for creating 'try it out' demo button 378 var imagePath = "http://www.android.com/images/brand/" 379 var linkStart = "<a href=\"http://market.android.com/"; 380 var imageStart = "\">\n" 381 + " <img src=\"" + imagePath; 382 var imageEnd = ".png\"\n" 383 + " alt=\"Available in Android Market\" />\n</a>"; 384 385 // variables for creating code snippet 386 var linkStartCode = "<a href=\"http://market.android.com/"; 387 var imageStartCode = "\">\n" 388 + " <img src=\"" + imagePath; 389 var imageEndCode = ".png\"\n" 390 + " alt=\"Available in Android Market\" />\n</a>"; 391 392 /** Generate the HTML snippet and demo based on form values */ 393 function buildButton(form) { 394 if (form["package"].value != "com.android.example") { 395 $("#preview").show(); 396 $("#snippet").show().html(linkStartCode + "details?id=" + form["package"].value 397 + imageStartCode + $('form input[type=radio]:checked').val() + imageEndCode); 398 $("#button-preview").html(linkStart + "details?id=" + form["package"].value 399 + imageStart + $('form input[type=radio]:checked').val() + imageEnd); 400 } else if (form["publisher"].value != "Example, Inc.") { 401 $("#preview").show(); 402 $("#snippet").show().html(linkStartCode + "search?q=pub:" + form["publisher"].value 403 + imageStartCode + $('form input[type=radio]:checked').val() + imageEndCode); 404 $("#button-preview").html(linkStart + "search?q=pub:" + form["publisher"].value + imageStart + 405 $('form input[type=radio]:checked').val() + imageEnd); 406 } else { 407 alert("Please enter your package name or publisher name"); 408 } 409 return false; 410 } 411 412 /** Listen for Enter key */ 413 function onTextEntered(event, form, me) { 414 // 13 = enter 415 if (event.keyCode == 13) { 416 buildButton(form); 417 } 418 } 419 420 /** When input is focused, remove example text and disable other input */ 421 function onInputFocus(object, example) { 422 if (object.value == example) { 423 $(object).val('').css({'color' : '#000'}); 424 } 425 $('input[type="text"]:not(input[name='+object.name+'])', 426 object.parentNode).attr('disabled','true'); 427 $('#'+object.name+'-clear').show(); 428 } 429 430 /** When input is blured, restore example text if appropriate and enable other input */ 431 function onInputBlur(object, example) { 432 if (object.value.length < 1) { 433 $(object).attr('value',example).css({'color':'#ccc'}); 434 $('input[type="text"]', object.parentNode).removeAttr('disabled'); 435 $('#'+object.name+'-clear').hide(); 436 } 437 } 438 439 /** Clear the form to start over */ 440 function clearLabel(id, example) { 441 $("#preview").hide(); 442 $('#'+id+'').html('').attr('value',example).css({'color':'#ccc'}); 443 $('input[type="text"]', $('#'+id+'').parent()).removeAttr('disabled'); 444 $('#'+id+'-clear').hide(); 445 return false; 446 } 447 448 /** When the doc is ready, find the inputs and color the input grey if the value is the example 449 text. This is necessary to handle back-navigation, which can auto-fill the form with previous 450 values (and text should not be grey) */ 451 $(document).ready(function() { 452 $(".button-form input.text").each(function(index) { 453 if ($(this).val() == $(this).attr("default")) { 454 $(this).css("color","#ccc"); 455 } else { 456 /* This is necessary to handle back-navigation to the page after form was filled */ 457 $('input[type="text"]:not(input[name='+this.name+'])', 458 this.parentNode).attr('disabled','true'); 459 $('#'+this.name+'-clear').show(); 460 } 461 }); 462 }); 463 464 </script> 465 466 <form class="button-form"> 467 <label class="block" for="package">Package name:</label> 468 <input class="text" type="text" id="package" name="package" 469 value="com.android.example" 470 default="com.android.example" 471 onfocus="onInputFocus(this, 'com.android.example')" 472 onblur="onInputBlur(this, 'com.android.example')" 473 onkeyup="return onTextEntered(event, this.parentNode, this)"/> 474 <a id="package-clear" style="display:none" href="#" 475 onclick="return clearLabel('package','com.android.example');">clear</a> 476 <p style="clear:both;margin:0"> <em>or</em></p> 477 <label class="block" style="margin-top:5px" for="publisher">Publisher name:</label> 478 <input class="text" type="text" id="publisher" name="publisher" 479 value="Example, Inc." 480 default="Example, Inc." 481 onfocus="onInputFocus(this, 'Example, Inc.')" 482 onblur="onInputBlur(this, 'Example, Inc.')" 483 onkeyup="return onTextEntered(event, this.parentNode, this)"/> 484 <a id="publisher-clear" style="display:none" href="#" 485 onclick="return clearLabel('publisher','Example, Inc.');">clear</a> 486 <br/><br/> 487 488 <div class="button-row"> 489 <input type="radio" name="buttonStyle" value="45_avail_market_logo1" id="ns" checked="checked" /> 490 <label for="ns"><img src="http://www.android.com/images/brand/45_avail_market_logo1.png" 491 alt="narrow and small logo" /></label> 492 493 <input type="radio" name="buttonStyle" value="60_avail_market_logo1" id="nm" /> 494 <label for="nm"><img src="http://www.android.com/images/brand/60_avail_market_logo1.png" 495 alt="narrow and large logo" /></label> 496 </div> 497 498 <div class="button-row"> 499 <input type="radio" name="buttonStyle" value="45_avail_market_logo2" id="ws" /> 500 <label for="ws"><img src="http://www.android.com/images/brand/45_avail_market_logo2.png" 501 alt="wide and small logo" /></label> 502 503 <input type="radio" name="buttonStyle" value="60_avail_market_logo2" id="wm" /> 504 <label for="wm"><img src="http://www.android.com/images/brand/60_avail_market_logo2.png" 505 alt="wide and large logo" /></label> 506 </div> 507 508 <input type="button" onclick="return buildButton(this.parentNode)" value="Build my button" 509 style="padding:5px" /> 510 <br/> 511 </form> 512 513 <div id="preview" style="display:none"> 514 <p>Copy and paste this HTML into your web site:</p> 515 <textarea id="snippet" cols="80" rows="4" onclick="this.select()" 516 style="font-family:monospace;background-color:#efefef;padding:5px;display:none;margin-bottom:1em"> 517 </textarea > 518 519 <p>Try it out:</p> 520 <div id="button-preview" style="margin-top:1em"></div> 521 </div> 522 523 524 525 526 527 528 <h3 id="UriSummary">Summary of URI formats</h3> 529 530 <p>The table below provides a summary of the URIs currently supported by the Android Market (both on 531 the web and in the Android application), as discussed in the previous sections.</p> 532 533 <table> 534 <tr> 535 <th>For this result</th> 536 <th>Use this URI in a web page link</th> 537 <th>Or this URI in an {@link android.content.Intent#ACTION_VIEW} intent</th> 538 </tr> 539 540 <tr> 541 <td>Display the details screen for a specific application</td> 542 <td><code>http://market.android.com/details?id=<package_name></code> 543 <td><code>market://details?id=<package_name></code></td> 544 </tr> 545 546 <tr> 547 <td>Search for applications using a general string query.</td> 548 <td><code>http://market.android.com/search?q=<query></code></td> 549 <td><code>market://search?q=<query></code></td> 550 </tr> 551 552 <tr> 553 <td>Search for applications by publisher name</td> 554 <td><nobr><code>http://market.android.com/search?q=pub:<publisher_name></code></nobr></td> 555 <td><nobr><code>market://search?q=pub:<publisher_name></code></nobr></td> 556 </tr> 557 558 </table> 559