0

I developed one parent and child communication Android application in which I wanted to restrict the child from uninstalling application. I have one solution that uses DevicePolicyManager. But still the application can be uninstalled without asking for password. If I remove the Device Administrator permission from the settings, then application is uninstalled from device?

Can anyone provide the valid solution for this cause?

Sathish Gadde
  • 1,453
  • 16
  • 28
  • Please, post the code you have already tried so others can help you. – FlyingPumba Aug 31 '16 at 13:28
  • @P.G.Progs I think your edit does not fit the original question. – LBes Aug 31 '16 at 13:29
  • 1
    Possible duplicate of [android: require password when uninstall app](http://stackoverflow.com/questions/24995553/android-require-password-when-uninstall-app) – LBes Aug 31 '16 at 13:30
  • If your MDM software has the feature to lock Device Administrator Settings screen, then it should be possible. Most of the MDM provides customizable scripts which can be used to lock. For example SOTI provides similar modifiable scripts https://www.soti.net/products/mobicontrol/overview/ – Sreehari Aug 31 '16 at 13:32

1 Answers1

0

You cannot prevent a user from uninstalling an app, from within the app code itself.

There is suggestions here How to prevent an application from being uninstalled?, but they are not foolproof.

The way around this is to use an android device with lollipop and upwards, so you can create a user account.

On the admin account, install an app that requires a password to uninstall apps. They are on the market (and free) I've used them. Or write one yourself.

Then on the child's account allow them whatever privileges you want them to have. They will be unable to touch the apps and uninstall them, unless on the admin account and with the password required for that app to uninstall other apps.

I have tried and tested this and it works.

Community
  • 1
  • 1