Reputation: 598
I want to make an app in android which should not be uninstalled by the user once its get installed in the device, which should be like an default app like market.
Upvotes: 6
Views: 6394
Reputation: 151
You can set app as device administrator. After user confirmation as device app users can't uninstall it while it has device admin status.
Problem is keeping it to be device admin as user can withdraw this status from it. App will get intent notification and may provide text to persuade user not to withdraw device admin status but if he/she insist app can respond by setting password and locking the whole device or to wipe data from device. This way the app still can be uninstall (by guessing the password) but you may take some actions to protect data and/or to send warning (if there is a connection) to some online service of yours.
Upvotes: 9
Reputation: 77752
This is simply impossible for a user-level app. For good reason - just imagine putting a malicious app on the market that cannot be removed!
The only way to do this would be with root privileges, like carriers do with pre-installed crapware that is stored on the read-only system partition of your phone.
It sounds like this is an internal app that you want to put on phones in your company (?). If that's the case, you will need to temporarily get root access and put the app on the system partition. There is no way to do this using the regular means available to a third-party app developer, and for good reason.
Upvotes: 12