Search code examples
androidapksilent-installer

Android APK's Silent Installation


I'm searching for a way to program my application to install silently an APK file. I'm aware about the possibility to launch with code that looks something like this:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);   

But before the installation starts, this code raises a dialog with the APK's required permissions, and needs user authorization to start the installation.

Is there any way to skip this dialog?

Is there any other way to install an application during runtime from my code, that doesn't require user interaction?


Solution

  • No. And that's a good thing - this would be an (other) open door to malware and unwanted installs. Why do you want to do that, if you mind me asking? What's wrong with letting users know that you want to install something on their device?

    Also, some details here: Silent installation on Android devices

    And finally, this might be possible for rooted devices: if you write your own installer, you can bypass completely the built-in installer, and with root privilege, you can basically do what you want. But I still think that would be a serious breach of security.