Reputation: 25858
Recently I am working on a Mobile Device Management application in that i implemented a case to delete an application from device remotely but the problem is user have to click on uninstall button to proceed .But as i think if we are managing the device and it should not be and it is sure that user will not click on uninstall button.
So is there any way so that so we can delete an application without user prompt or we can something like automatically click on uninstall button when the activity called.
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE);
uninstallIntent.setData(Uri.parse("package:" + packageName));
uninstallIntent.setAction(Intent.ACTION_VIEW);
uninstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(uninstallIntent);
I am using this code calling uninstall activity.
Upvotes: 2
Views: 4116
Reputation: 457
Well for all I know it's not possible to install uninstall packages without a user permission prompt, for a more technical answer reffer to this sources: Third Party Uninstalling - this states that the only way to install uninstall packages is asking the Android OS to do it for you, Intent or Package Manager install - this states that there is a special method to install/uninstall packages, but it can only be used by system apps.
So the only apparent way to install and uninstall packages would be an intent, and this intent will always show a prompt for installing uninstalling packages.
Upvotes: 2