Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop uninstallation of application

Tags:

android

i create an app and install it on phone. now i want to add a feature that my app should not uninstall from the phone. so i think if one of the following issues could be solved

  1. is there anyway to stop the user from uninstall the app?
  2. is it possible , if user try to uninstall the app we get a message?
  3. is it possible , if user try to uninstall the app it should prompt for a password ?
  4. any other way to know that app got uninstalled?

Please guide me in this regard thanks in advance

like image 464
nimi Avatar asked Dec 18 '10 07:12

nimi


3 Answers

Yes, this can be done.

Create a new firmware image for a phone, include your app in the /system/app directory and, since this directory is read-only during runtime, the app cannot be uninstalled. i.e. it is pre-installed.

Otherwise no, this cannot be done. However, with a non-system app, the system does notify other applications after your app has been uninstalled via a PACKAGE_REMOVED broadcast.

So it's possible to determine that your app was uninstalled, but — without flashing the whole phone with a new firmware — there is no way to prevent your application from being uninstalled. Which is a good thing.

like image 98
Christopher Orr Avatar answered Oct 31 '22 10:10

Christopher Orr


is there any way to stop the user from uninstall the app?

I hope there isn't.

Try to make an application that users will not want to uninstall anyway :)

like image 3
cherouvim Avatar answered Oct 31 '22 09:10

cherouvim


is it possible , if user try to uninstall the app we get a message?

As Christopher said above, you can be notified when the user has removed your application.

PACKAGE_REMOVED broadcast is sent to notify that a package is removed. You can use it to get notified.

But I don't find it right to "prevent" user from removing your application. As a matter of UX, its their phone, and they've got full rights to add/remove whatever they want.

It is the same with PCs too!

like image 1
Aman Alam Avatar answered Oct 31 '22 09:10

Aman Alam