How to Open the Google Play Store Directly from My Android Application

How to open the Google Play Store directly from my Android application?

You can do this using the market:// prefix.

Java

final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}

Kotlin

try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=$packageName")))
} catch (e: ActivityNotFoundException) {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=$packageName")))
}

We use a try/catch block here because an Exception will be thrown if the Play Store is not installed on the target device.

NOTE: any app can register as capable of handling the market://details?id=<appId> Uri, if you want to specifically target Google Play check the Berťák answer

How to open Google play store app directly without chooser intent

use this code...it works for me

final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
}
catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}

Is any right approch to open direct google play store after click button in android

This solution is worked fine for me .

fun shareApp(appPackageName: String, activity: Activity){
try {
startActivity(Intent(
Intent.ACTION_VIEW,
Uri.parse("market://details?id=$appPackageName")
))
} catch (e : ActivityNotFoundException) {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/details?id=$appPackageName")
)
)
}
}

So here we use two things if any devices specific app store available then it open it and otherwise it open play store directly . and showing your app.

Whenever i click on button then it showing me choice for select market app or play store , when i click on play store then it open and show related app.

I hope this help you..

Open play store app from browser link

I got it working by using the below url on redirect

window.location.href = "https://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id=com.myapp";

When I visit this url from the browser of my mobile, it does not open the play store within browser but opens the play store app instead. This serves my purpose.

App in Open Testing phase on Play Store can't be accessed

If you see there it says "In review", you should expect them to review and approve it since there are many cases of misuse of apps in the Play Store.
Sample Image

Can we open google play store subscription screen from other app?

Yes you can.
If a user doesn't have any such subscriptions within your app, direct them to the page showing all of their other subscriptions.

http://play.google.com/store/account/subscriptions

If, on the other hand, a user does have a non-expired subscription, you can navigate them directly to their subscription

https://play.google.com/store/account/subscriptions?sku=your-sub-product-id&package=your-app-package



Related Topics



Leave a reply



Submit