page.title=Publishing on Android Market @jd:body

Quickview

In this document

  1. About Android Market
  2. Publishing Updates on Android Market
  3. Using Android Market Licensing Service
  4. Linking to Your Apps on Android Market
    1. Opening an app's details page
    2. Performing a search
    3. Summary of URI formats

See also

  1. Application Licensing
  2. Preparing to Publish

Interested in publishing your app on Android Market?

Go to Android Market to create a developer account and upload your application. For more information about the required assets, listing details, and options, see Uploading applications.

If you've followed the steps outlined in Preparing to Publish, 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.

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.

About Android Market

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 (market.android.com). 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.

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.

To register as an Android Market developer and get started with publishing, visit the Android Market publisher site:

http://market.android.com/publish

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.

Requirements enforced by the Android Market server:

  1. Your application must be signed with a cryptographic private key whose validity period ends after 22 October 2033.
  2. Your application must define both an android:versionCode and an android:versionName attribute in the <manifest> element of its manifest file. The server uses the android:versionCode as the basis for identifying the application internally and handling updates, and it displays the android:versionName to users as the application's version.
  3. Your application must define both an android:icon and an android:label attribute in the <application> element of its manifest file.

Publishing Updates on Android Market

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.

Before uploading the updated application, be sure that you have incremented the android:versionCode and android:versionName attributes in the <manifest> 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 not 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.

Using Android Market Licensing Service

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.

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.

For complete information about Android Market Licensing Service and how to use it in your application, read Application Licensing.

Linking to Your Apps on Android Market

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:

You can launch the Android Market application or web site in the following ways:

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.

To open the Android Market application on the device, the prefix for the intent's data URI is:

market://

To open the Android Market web site, the prefix for the link URI is:

http://market.android.com/

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.

Note: 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.

Opening an app's details page

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.

The format for the URI that opens the details page is:

<URI_prefix>details?id=<package_name>

The <package_name> is a placeholder for the target application's fully qualified package name, as declared in the {@code package} attribute of the {@code <manifest>} element in the application's manifest file.

Opening details in the Android Market application

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:

market://details?id=<package_name>

For example, here's how you can create an intent and open an application's details page in the Android Market application:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.android.example"));
startActivity(intent);

Opening details on the Android Market web site

To open the details page on the Android Market web site, create a link with a URI in this format:

http://market.android.com/details?id=<package_name>

For example, here's a link that opens an application's details page on the Android Market web site:

<a href="http://market.android.com/details?id=com.android.example">App Link</a>

Performing a search

To initiate a search in Android Market, the format for the URI is:

<URI_prefix>search?q=<query>

The <query> 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:

Searching the Android Market application

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:

market://search?q=<query>

The query may include the {@code pub:} parameter described above.

For example, here's how you can initiate a search in the Android Market application, based on the publisher name:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://search?q=pub:Your Publisher Name"));
startActivity(intent);

The search result shows all applications published by the publisher and which are compatible with the current device.

Searching the Android Market web site

To perform a search on the Android Market web site, create a link with a URI in this format:

http://market.android.com/search?q=<query>

The query may include the {@code pub:} parameter described above.

For example, here's a link that initiates a search on the Android Market web site, based on the publisher name:

<a href="http://market.android.com/search?q=pub:Your Publisher Name">Search Link</a>

The search result shows all applications published by the publisher.

Summary of URI formats

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.

For this result Use this URI in a web page link Or this URI in an {@link android.content.Intent#ACTION_VIEW} intent
Display the details screen for a specific application http://market.android.com/details?id=<package_name> market://details?id=<package_name>
Search for applications using a general string query. http://market.android.com/search?q=<query> market://search?q=<query>
Search for applications by publisher name http://market.android.com/search?q=pub:<publisher_name> market://search?q=pub:<publisher_name>