简体   繁体   中英

Android install apk without asking user permission

I am building a App for kiosk mode purposes. The device is not rooted. The app is the device administrator (android.permission.BIND_DEVICE_ADMIN) . I want the app to be able to download and direct install other apks onto the tablet without asking for permission.

At moment I am using Android DownloadManager to download the apk: then:

Intent intent = new Intent(Intent.ACTION_VIEW);
                                intent.setDataAndType(Uri.fromFile(new File(filePath)), "application/vnd.android.package-archive");
                                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // without this flag android returned a intent error!
                                DownloadManagerActivity.this.startActivity(intent);

To install the apk. But this bring a popup for confirmation. is theer another away to direct install the apk after it has been downloaded? Thanks

update :

I came across this post: https://paulononaka.wordpress.com/2011/07/02/how-to-install-a-application-in-background-on-android/

But it does not work and it very limited.

There is no way to install the APK without the popup confirmation. This is a by-design security feature. Some phone vendors like Samsung offer options like SAFE or KNOX to allow that installing without a prompt, but it requires additional permissions and these technologies are not available across all android devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM