0

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.

Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74

1 Answers1

1

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.

Fred
  • 2,191
  • 1
  • 12
  • 14
  • Thanks, Fred. I am developing a parental control app like Google Family Link for the child. Is it possible to develop an app like that using Android Enterprise? Can we disable/enable the app, lock/unlock devices using AE? Also, Can I track location, block/unblock all app installation and uninstallation? I found that we can manage only fully device or work profile only. So is it possible to develop this kind of app using Android Enterprise? – Chirag Savsani Jul 30 '19 at 02:15
  • All of this is possible, as long as the device is fully managed. Which means it must be factory reset and then enrolled as a fully managed device using the Android Management API, via a QR code for example. It's also possible to create a work profile, for parental control this doesn't make sense since part of the device would remain unmanaged. – Fred Aug 04 '19 at 19:40
  • Is it possible to use an app without setting a device owner? Like Family Link app is working without setting the device owner. – Chirag Savsani Aug 05 '19 at 06:19
  • I think Family Link [requires factory reset](https://support.google.com/families/answer/7158477) to work in supervised mode, so this is similar. – Fred Aug 05 '19 at 19:18