Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1698fd60 authored by Scott Main's avatar Scott Main
Browse files

cherrypick Change-Id: Ib8e73aabb6369a25599aca2351f69cc56333578e

docs: clarify that the market app responds to http urls

Change-Id: Ie9afca5d2e3072bd85c4eb7da1debbf1b5ec02a0
parent 34235c6e
Loading
Loading
Loading
Loading
+59 −52
Original line number Original line Diff line number Diff line
@@ -155,48 +155,43 @@ href="{@docRoot}guide/publishing/licensing.html">Application Licensing</a>.</p>


<p>To help users discover your published applications, you can use two special Android Market URIs
<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
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>
applications in Android Market. You can use these URIs to create a button in your application or a
link on a web page that:</p>


<ul>
<ul>
  <li>Create a button in your application or a link on a web page that opens one of your
  <li>Opens your application's details page in the Android Market application or web site.</li>
application's details page in the Android Market application or web site.</li>
  <li>Searches for all your published applications in the Android Market application or web
  <li>Create a button in your application or a link on a web page that searches for all your
site.</li>
published applications in the Android Market application or web site.</li>
</ul>
</ul>


<p>You can launch the Android Market application or web site in the following ways:</p>
<p>You can launch the Android Market application or web site in the following ways:</p>
<ul>
<ul>
  <li>Initiate an {@link android.content.Intent} from your application that launches the
  <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 Market application on the user's device.</li>
android.content.Intent#ACTION_VIEW} action, and include intent data with the appropriate
  <li>Provide a link on a web page that opens the Android Market web site (but will also
Android Market URI scheme.</li>
open the Android Market application if clicked from a device).</li>
  <li>Provide a hyperlink on a web page that opens the Android Market web site.</li>
</ul>
</ul>


<p>In both cases, you need to create a URI that indicates either the application you'd like to view
<p>In both cases, whether you want to initiate the action from your application or from a web
in Android Market or the search you'd like to perform. The URI is quite similar whether you want
page, the URIs are quite similar. The only difference is the URI prefix.</p>
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
<p>To open the Android Market application from your application, the prefix for the intent's data
is:</p>
URI is:</p>


<p style="margin-left:2em"><code>market://</code></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>To open Android Market from your web site, the prefix for the link URI is:</p>


<p style="margin-left:2em"><code>http://market.android.com/</code></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
<p>The following sections describe how to create a complete URI for each action.</p>
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
<p class="note"><strong>Note:</strong> If you create a link to open Android Market from your web
the user selects it from an Android-powered device, the Android Market application will also resolve
site and the user selects it from an Android-powered device, the device's Market application will
the link so the user can use the native application instead of the web site. Also, because the
resolve the link so the user can use the Market application instead of opening the web
Android Market application also reads the {@code http://} URIs, you can also use them in an intent,
site. As such, you should always use {@code http://market.android.com/} URIs when creating a link on
but you should usually use the {@code market://} URIs for an intent, so that the native application
a web page. When pointing to your apps from within your Android app, use the
is opened by default. You should use {@code http://} URIs only when creating links from a web
{@code market://} URIs in an intent, so that the Market application always opens.</p>
page.</p>




<h3 id="OpeningDetails">Opening an app's details page</h3>
<h3 id="OpeningDetails">Opening an app's details page</h3>
@@ -209,22 +204,23 @@ the application description, screenshots, reviews and more, and choose to instal


<p style="margin-left:2em"><code>&lt;URI_prefix&gt;<b>details?id=</b>&lt;package_name&gt;</code></p>
<p style="margin-left:2em"><code>&lt;URI_prefix&gt;<b>details?id=</b>&lt;package_name&gt;</code></p>


<p>The <code>&lt;package_name&gt;</code> is a placeholder for the target application's fully
<p>The <code>&lt;package_name&gt;</code> is a placeholder for the target application's
qualified package name, as declared in the <a
fully-qualified package name, as declared in the <a
href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code
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
package}</a> attribute of the <a href="{@docRoot}guide/topics/manifest/manifest-element.html">{@code
&lt;manifest&gt;}</a> element in the application's manifest file.</p>
&lt;manifest&gt;}</a> element.</p>




<h4>Opening details in the Android Market application</h4>
<h4>Opening the app details page from your Android app</h4>


<p>To open the details page in the Android Market application, create an intent with the
<p>To open the Android Market details page from your application,
{@link android.content.Intent#ACTION_VIEW} action and include a data URI in this format:</p>
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=&lt;package_name&gt;</code></p>
<p style="margin-left:2em"><code>market://details?id=&lt;package_name&gt;</code></p>


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


<pre>
<pre>
Intent intent = new Intent(Intent.ACTION_VIEW);
Intent intent = new Intent(Intent.ACTION_VIEW);
@@ -232,23 +228,30 @@ intent.setData(Uri.parse("market://details?id=com.android.example"));
startActivity(intent);
startActivity(intent);
</pre>
</pre>


<p>This will open the Android Market application on the device to view the {@code
com.android.example} application.</p>



<h4>Opening details on the Android Market web site</h4>
<h4>Opening the app details page from a web site</h4>


<p>To open the details page on the Android Market web site, create a link with a URI in this
<p>To open the details page from your web site, create a link with a URI in this
format:</p>
format:</p>


<p style="margin-left:2em">
<p style="margin-left:2em">
  <code>http://market.android.com/details?id=&lt;package_name&gt;</code>
  <code>http://market.android.com/details?id=&lt;package_name&gt;</code>
</p>
</p>


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


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


<p>When clicked from a desktop web browser, this opens the Android Market web site to view the
{@code com.android.example} application. When clicked from an Android-powered device, users are
given the option to use either their web browser or the Android Market application to view the
application.</p>





<h3 id="PerformingSearch">Performing a search</h3>
<h3 id="PerformingSearch">Performing a search</h3>
@@ -274,9 +277,9 @@ by the publisher name:
</ul>
</ul>




<h4>Searching the Android Market application</h4>
<h4>Searching from your Android app</h4>


<p>To perform a search in the Android Market application, create an intent with the
<p>To initiate a search on Android Market from your application, create an intent with the
{@link android.content.Intent#ACTION_VIEW} action and include a data URI in this format:</p>
{@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=&lt;query&gt;</code></p>
<p style="margin-left:2em"><code>market://search?q=&lt;query&gt;</code></p>
@@ -292,13 +295,13 @@ intent.setData(Uri.parse("market://search?q=pub:Your Publisher Name"));
startActivity(intent);
startActivity(intent);
</pre>
</pre>


<p>The search result shows all applications published by the publisher and which are compatible with
<p>This opens the Android Market application to perform the search. The search result shows all
the current device.</p>
applications published by the publisher that are compatible with the current device.</p>




<h4>Searching the Android Market web site</h4>
<h4>Searching from a web site</h4>


<p>To perform a search on the Android Market web site, create a link with a URI in this
<p>To initiate a search on Android Market from your web site, create a link with a URI in this
format:</p>
format:</p>


<p style="margin-left:2em">
<p style="margin-left:2em">
@@ -307,26 +310,31 @@ format:</p>


<p>The query may include the {@code pub:} parameter described above.</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
<p>For example, here's a link that initiates a search on Android Market, based on the
publisher name:</p>
publisher name:</p>


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


<p>The search result shows all applications published by the publisher.</p>
<p>When clicked from a desktop web browser, this opens the Android Market web site and performs the
search. When clicked from an Android-powered device, users are given the option to use either their
web browser or the Android Market application to perform the search.</p>






<h3 id="BuildaButton">Build an Android Market button</h3>
<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
<p>Use the following form to generate an "Available in Android Market" button that you can use on
and generate a button that you can use on your web site. The button will take users to Android
your web site. Input either your application's package name or publisher name and the button will
Market to view your application details or view a list of all applications you've published.</p>
take users to Android Market to either view your application's information or view a list of
your published apps. If users click the button while on an Android-powered device, the Android
Market application will respond to show users your application(s).</p>


<p>This form offers four versions of the official "Available in Android Market" badge at
<p>This form offers four versions of the official "Available in Android Market" button at
recommended sizes. If you would like to create a different size, you can download an EPS file for
recommended sizes. If you want 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>
the button images from the <a href="http://www.android.com/branding.html">Android Brand
Guidelines</a>.</p>


<style type="text/css">
<style type="text/css">
  
  
@@ -548,4 +556,3 @@ the web and in the Android application), as discussed in the previous sections.<
</tr>
</tr>


</table>
</table>