Android Link to Market from inside another app

29,840

Solution 1

Yes, there is a documented Intent syntax for that (http://market.android.com/search?q=pub:<Developer Name> or market://search?q=pub:<Developer Name>).

Solution 2

Even better to use "market://details" instead of "market://search":

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

Then it opens directly the details page of the app. With search it shows a single search result and the user has to do an additional click to get to the detail page.

Solution 3

The intent action would be view, and uri the market url/uri.

Like this:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:<developer name>") ) );

Solution 4

Another way is to launch a URL Intent with your application's package name in it. User will get popup with list of installed Browsers + Play Store app in which he can view your target app.

String appPackageName = "com.example.android";
String url = "https://play.google.com/store/apps/details?id=" + appPackageName;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);

Above code is tested and works as expected on Play Store version 4.1.6

Solution 5

On my real devices Sony Xperia Pro and PocketBook tablet, even when you put a link to play web store e.g. https://play.google.com/store/apps/details?id=com.estrongs.android.pop It will ask if you want to open it in the default browser or in the Play market. If you select Play market - application is shown as expected. Did not test it with intent, tested with Autolink from TextView.

Share:
29,840
Ian Vink
Author by

Ian Vink

https://mvp.microsoft.com/en-us/PublicProfile/5002789?fullName=Ian%20Vink

Updated on May 13, 2020

Comments

  • Ian Vink
    Ian Vink about 4 years

    I am building many apps for Android and wish to have a menu button in the apps that basically opens a list of my other apps in the Android Market.

    Is there a way to create an intent and have the Android market pop up with a search (of my company) in the market so users can buy other apps?

    ian

  • gregm
    gregm about 12 years
    is there an updated link for google play or is it still "market"
  • CommonsWare
    CommonsWare about 12 years
    @gregm: Looks like it is still market: developer.android.com/guide/publishing/…
  • Hamid
    Hamid almost 12 years
    @CommonsWare Do you know if this still works? I have been trying on a Galaxy S 3 with Play Store 3.7.15 and it doesn't work if I include "pub:" but works fine if I just put the publisher name as the query. I don't like doing it that way though since other stuff could essentially turn up.
  • aacotroneo
    aacotroneo almost 11 years
  • gio
    gio almost 9 years
    simplified version for Android Studio startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + BuildConfig.APPLICATION_ID)));
  • Manikandan
    Manikandan over 8 years
    @ CommonsWare, how can i open an app, from other than google playstore (from china, where we have many app stores)