Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top