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.
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
Programmatically Obtain the Phone Number of the Android Phone
How Exactly Does the Android:Onclick Xml Attribute Differ from Setonclicklistener
Open Another Application from Your Own (Intent)
Changing Locale Within the App Itself
How to Manually Include External Aar Package Using Gradle For Android
Android: How to Get String from Resources Using Its Name
Integrating the Zxing Library Directly into My Android Application
How Can an App Detect That It's Going to Be Uninstalled
Android Fatal Signal 11 (Sigsegv) At 0X636F7D89 (Code=1). How Can It Be Tracked Down
"Debug Certificate Expired" Error in Eclipse Android Plugins
Static Way to Get 'Context' in Android
Find Location of a Removable Sd Card
Key Hash For Android-Facebook App
How to Get Zoom Functionality For Images
Android: Difference Between Parcelable and Serializable