0

I have struck an idea of creating an app that automatically installs all the .apk packages placed inside a particular folder. In context to this, I want to learn how do I programmatically access installer service ?

Please enlighten me in this regard.

CodeWalker
  • 2,281
  • 4
  • 23
  • 50

1 Answers1

0

Your best bet would be to set an intent with type application/vnd.android.package-archive and then start installer activity:

Intent promptInstall = new Intent(Intent.ACTION_VIEW)
    .setDataAndType(Uri.parse("file:///path/to/your.apk"), 
                    "application/vnd.android.package-archive");
startActivity(promptInstall); 

Check out Install Application programmatically on Android

Also, note, that for security reasons, you cannot install an apk 'silently' or automatically without user agreement. Therefore, the best you can do is like above.

Community
  • 1
  • 1
AmmarCSE
  • 30,079
  • 5
  • 45
  • 53