Block/unblock an application from my application: Android

10,230

Solution 1

If Android OS on the phone is not rooted you won't be able to block another application. Os doesn't give rights to do that. Android runs on Linux, Linux provides sandbox system call API and dictates rules.

http://developer.android.com/guide/topics/security/permissions.html

Basically you can do what is allowed to do. Intercept call's, block camera via device admin manager, read data of another apps if they share that data and only what they share, use some common resources, but not more than that. To do what you want to do your app has to be a root, but standard third party apps don't get root privileges. Your solution can be to change firmware, bind your app into it with root privileges.

Solution 2

Start a Service Using Alarm Manager on every second Inside Service You have an array of Installed app and now you detect Top most App is running Top Task match with your array of application than you launch your Protector

I have Done already

Share:
10,230
Android Learner
Author by

Android Learner

http://stackoverflow.com/users/edit/1109344

Updated on June 25, 2022

Comments

  • Android Learner
    Android Learner almost 2 years

    I want to block/unblock (where user can not use/access the blocked application) some application in an android device from my application. But I couldn't find any solution/ idea about this.

    I read Android how to programmatically hide launcher icon, but this hide the application launcher icon of same application.

    How can I do this? Please share some idea/links about this.

  • Android Learner
    Android Learner almost 12 years
    Some application gives the same functionality, so I think this can be possible.
  • Maxim
    Maxim almost 12 years
    Those apps apparently pre-built with Android firmware. Manufacturers get firmware before it goes to the rest of the world. Make necessary changes to give more privileges to their app and bind it with Android ROM. You cannot uninstall those apps.
  • Android Learner
    Android Learner almost 12 years
    The link you have given is not giving any information about my problem. And I am not asking about uninstall the application. I simply asking about a process where user can not use any blocked application.
  • banzai86
    banzai86 almost 12 years
    And Maxim's answer was that you have to have root privileges to block other apps. And you will only get them on a rooted device.
  • Android Learner
    Android Learner about 11 years
    Waoo.. Can you share more in details?
  • Hypersoft Systems
    Hypersoft Systems over 4 years
    Not sure 'Kill your battery' is the best option.