Block/unblock an application from my application: Android

安稳与你 提交于 2019-12-10 03:44:00

问题


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.


回答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.




回答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



来源:https://stackoverflow.com/questions/11453814/block-unblock-an-application-from-my-application-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!