I'm developing a lite version for an app on the Android. How can I start an Intent to open the Android Market, preferably with the full version of my app displayed? This is difficult to test on an emulator (which is the closest thing to a device I have), as there seems to be no legal way of installing the Market on it.
Asked
Active
Viewed 9,665 times
3 Answers
30
That query above works, but when I tried it, it looked like it was bringing up search results based on the name.
If you use something like
intent.setData(Uri.parse("market://details?id=com.wolinlabs.SuperScorepad"));
instead, it will go right to the Android Market page for your app.
I think that's more what you wanted (?)

gulchrider
- 4,306
- 3
- 25
- 16
-
thanks a lot buddy for this.. I wanna knw if there is Url to open more apps by a developer???? Url Url opens the application.. There is an option to see more apps.. I want the URL for that.. :) – Nikhil Aneja Apr 01 '12 at 13:06
-
Yes, there is, it is described in the publishing guidelines[link](http://developer.android.com/guide/publishing/publishing.html). Use this: **market://search?q=pub:
** – Anton Cherkashyn May 02 '12 at 00:44 -
This one opens the market in a view of the same application, to really open the market separately look my answer. – code4jhon Jul 29 '14 at 02:58
23
Found answer in the end:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://search?q=pname:MyApp"));
startActivity(intent);
No way of testing on emulator, though.

Tom R
- 5,991
- 9
- 35
- 41
-
Is that any flag I can set to the intent to prevent google play showing open button for my app. http://stackoverflow.com/questions/10185326/opening-my-application-from-google-play-app-crashes-on-exit/10185486#10185486 http://stackoverflow.com/questions/10174892/extended-application-class-force-close-on-restart-android#comment13073329_10174892 – Mahendran Apr 20 '12 at 13:10
-
This one opens the market in a view of the same application, to really open the market separately look my answer. – code4jhon Jul 29 '14 at 02:59
-
What about Developer? How to open Developer name for all application?? – Pratik Butani Sep 14 '14 at 13:09
1
Hi I was trying the achieve the same but with one small difference
I DIDN'T WANT TO OPEN IT EMBEDDED ON MY APP
public void start(JSONArray args, CallbackContext callback) {
Intent launchIntent;
String packageName;
String activity;
String uri;
ComponentName comp;
try {
packageName = args.getString(0); //com.android.vending
activity = args.getString(1); //com.google.android.finsky.activities.LaunchUrlHandlerActivity
uri = args.getString(2); //'market://details?id=com.triplingo.enterprise'
launchIntent = this.cordova.getActivity().getPackageManager().getLaunchIntentForPackage(packageName);
comp = new ComponentName(packageName, activity);
launchIntent.setComponent(comp);
launchIntent.setData(Uri.parse(uri));
this.cordova.getActivity().startActivity(launchIntent);
callback.success();
} catch (Exception e) {
callback.error(e.toString());
}
}
THE BIG DIFFERENCE HERE IS THAT YOU START A NEW APP NOT JUST SHOW GOOGLE PLAY IN YOUR APP
This code is part of a Cordova plugin but is pretty obvious what you need to do to use it natively.
THE IMPORTANT LINES
launchIntent = this.cordova.getActivity().getPackageManager().getLaunchIntentForPackage(packageName);
comp = new ComponentName(packageName, activity);
launchIntent.setComponent(comp);
launchIntent.setData(Uri.parse(uri));
Regards

code4jhon
- 5,725
- 9
- 40
- 60