Reputation: 13
How to prevent an application from being uninstalled. How to stop it using code when user want to delete the application ? How can we do that using programming ?
Upvotes: 0
Views: 2382
Reputation: 685
One possible way may be android os customization. Otherwise I think you can't do this. You can see this Stop uninstallation of application
Without customization, you can get a message(using intent) when user try to uninstall a package.
Upvotes: 1
Reputation: 284
You should look at Device Administration .
Once the application is registered as a Device Administrator, it can't be uninstalled unless its unregistered. This will prevent the app from being uninstalled.
You can password protect your application to prevent someone from tampering with the Device Admin features in the app.
Please read this example. It is explaining all the details with sample tutorial.
Upvotes: 0
Reputation: 6108
Device Administrator Once the application is registered as a Device Administrator, it can't be uninstalled unless its unregistered. This will prevent the app from being uninstalled
Upvotes: 0