I have an app 'A' of version 1 already installed in a Android device. And another app 'B' which has version 2 APK of app 'A'. The app 'B' should autamatically update the app 'A' with version 2. I have done it this way:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + apkPath), APK_MIMETYPE);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
The problem is that it prompts for user intervention (asks to click on 'install' button) to update the app 'A'.I require the app 'A' to be updated silently in the background.
Conditions:
- The device is not rooted.
- System certificate keys are available. The app 'B' can be made to run as a system app with shareduserid as
android.uid.system
.
Is it possible to do silent upgradation with the above conditions ? Can it be done from shell command programatically using Runtime.getRuntime().exec()
API ?