2

Possible Duplicate:
Require a password to uninstall/remove application

Hello everyone,

I want to develop an application to prevent all installed application in phone from being uninstall. Can I restrict any user to uninstall application from phone? I mean to say can I bind any constraint with application that whenever any user going to uninstall that application at that time it ask for Password? I searched around internet but didn't find any useful.

Waiting for reply.

Community
  • 1
  • 1
Nimit
  • 1,714
  • 3
  • 22
  • 33

1 Answers1

3

Sorry for English. I'm not good speaking.

U can create an application which will be listening for "Activity starting" event. When u catch this event u can show/start your own activity. This activity will supplant uninstall activity. To catch event - use logcat reading. Currently, I'm finishing with such application, it will protect such actions with password.

UAS
  • 405
  • 2
  • 4
  • 9
  • 1
    Thanks UAS. Can you please explain your answer. Language is not issue, You are good in English. You may send answer in your language, I will convert it. – Nimit Mar 23 '11 at 07:28
  • Hmm, I think Russian is not to be good translated to your language. So, first read here in my blog http://uas.name/android/android-new-activity-started-event-catch (the main thing is Java-code, other is just words). Using this code u can read a logcat. Android usually writes a string, where it describes info about launched activity. After that u should launch an "uninstall activity" and look a logcat for new entry appeared. So, your app must be runned as a service, which will be read logcat. When a log entry appears (about launching uninstall) u should start your activity (with password) – UAS Mar 23 '11 at 11:47
  • startActivity, for example. This activity contains a field, where user enters password. If password correct - just call "finish();" and user will grant an access to uninstall. If password is incorrect - you should programmly launch Home screen (or just another activity to launch). That's all. If there's question - u can contact me by ICQ #333411702 – UAS Mar 23 '11 at 11:55
  • @UAS how to implement this into Android Jellybeans?,bcoz reading log is restricted. – PrvN Jul 24 '13 at 12:25
  • Hi @UAS can yo give another site or explanation for how you did it? because i can't reach your site what you previously mention it. – Subramani Jan 09 '18 at 12:30