Google play store android application

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

I have open the Google Play store using the following code

But it shows me a Complete Action View as to select the option (browser/play store). I need to open the application in Play Store directly.

24 Answers 24

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

Kotlin

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= Uri, if you want to specifically target Google Play check the Berťák answer

Many answers here suggest to use Uri.parse(«market://details?id=» + appPackageName)) to open Google Play, but I think it is insufficient in fact:

Some third-party applications can use its own intent-filters with «market://» scheme defined, thus they can process supplied Uri instead of Google Play (I experienced this situation with e.g.SnapPea application). The question is «How to open the Google Play Store?», so I assume, that you do not want to open any other application. Please also note, that e.g. app rating is only relevant in GP Store app etc.

To open Google Play AND ONLY Google Play I use this method:

The point is that when more applications beside Google Play can open our intent, app-chooser dialog is skipped and GP app is started directly.

Источник

Читайте также:  Usb otg checker для андроид
Оцените статью