Possible Duplicate:
Service based Android application on Google Play Store

I'm developing an application which uses Android's device admin APIs.
http://developer.android.com/training/enterprise/device-management-policy.html#ActivateDeviceAdmin

As mentioned in link above "Before enforcing any policies, the user needs to manually activate the application as a device administrator. "

Can I override this step programmatically? I want my application to be always enabled and do not want to depend on the user to enable it.
Is there anyway that in my code I can set my application to be enabled?
Or is user intervention un-avoidable?

有帮助吗?

解决方案

yes its un-avoidable.
but after that if you want that you get to know that user is turning off your app from being device admin, you get a callback(broadcast) of the same.

There you can make some logic like showing some error message and all to the user, to discourage it to do that, obviously you can not stop him to do that.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top