Is there a way to build an Android application that can download and install other apks silently without asking the user's permission to install them?
So far to download the apks is easy, the problem is when installing them as they require the user's approval to be installed.
So far I have tried the following code
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(s)), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // without this flag android returned a intent error!
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivityForResult(intent, INSTALL_APK);
This asks for the user's approval to install the apk. Is there another way to do this without prompting the user?
Thanks