0

I Checked for answers on stack overflow, but no avail.

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

I have tried this code, This will launch playstore or browser. But i need to install the application directly without pressing the install or accept permissions.

Priya
  • 1,359
  • 6
  • 21
  • 41
Dhiman
  • 11
  • 3
  • No that would be a security issue. (If that was possible, what purpose would permission have??) –  Mar 30 '16 at 05:24

1 Answers1

0

But i need to install the application directly without pressing the install or accept permissions.

No you cannot do that from play store. You might probably be able do it if you have the apk (in case it is your own application) with you and have it included in your application, or download it directly in the background.

To learn about how to silently install an app check this post

Community
  • 1
  • 1
Viral Patel
  • 32,418
  • 18
  • 82
  • 110