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