0

Opening Google Play store on a specific app is pretty straight forward using something like

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=MyApp")));

This will open the Play Store, but the user will still have to click the download link. Is it possible to tell the Play Store that the intent is not to view the app, but to download the app? It's fine if the Play Store still asks the user for confirmation, but I just want to skip the part of showing the user the whole app again - something he already knows he wants.

Jack
  • 16,506
  • 19
  • 100
  • 167

2 Answers2

1

I found this code from below link

Programmatically download APK from google play store

and this is a code to just open your app on play sotre

          try {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=appname")));
            } catch (android.content.ActivityNotFoundException anfe) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=appname")));
            }
Community
  • 1
  • 1
Meenal
  • 2,879
  • 5
  • 19
  • 43
0

jost use "rdid" in Uri:

try {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=appname&rdid=appname")));
    } catch (android.content.ActivityNotFoundException anfe) {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=appname&rdid=appname")));
    }
roghayeh hosseini
  • 676
  • 1
  • 8
  • 21