简体   繁体   中英

Not able to apply Policy of Android Enterprise

I am creating an app with the use of Android Enterprise.

For that, I added dependencies in the build.gradle file.

implementation 'com.google.apis:google-api-services-androidmanagement:v1-rev84-1.25.0'

I am trying to disable uninstalling application using below code from here

try{
    Policy policy = new Policy();
    policy.setUninstallAppsDisabled(true);
} catch (Exception e) {
    e.printStackTrace();
}

But above code is not working. No any Exception or Warning arise

What I am missing? Not able to found proper documentation that how to use Enterprise Management API.

Using the client library of the Android Management API from an Android app is not enough the manage the device the app is running on. You need to first set up the device as managed. For that you can follow the instructions in the quickstart guide .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM