i have a code which download the apk from server by using Asynctask, Currently the new intent will pop up and ask the user for the permission, how to make the apps will auto install the apk after the download is done. i want to put the progress of the installation in the notification bar like google play store did 🙂
Below is the code how i show the apk:
@Override
protected void onPostExecute(Void unused) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file:///sdcard/MaxApps/3d.apk"), "application/vnd.android.package-archive");
startActivity(intent);
}
I would guess that this is (luckily) not possible, as the user needs to confirm the installation of new apps (especially if they’re requesting permissions)