Environment preparation and user enrollment

  • The Android Management API (AMAPI) SDK facilitates communication between EMM custom DPC apps and Android Device Policy, streamlining device enrollment.

  • The AMAPI SDK is essential for installing and updating Android Device Policy and initiating the user login sequence on the device.

  • TheEnvironmentClient within the AMAPI SDK manages prerequisites like ensuring minimum API level, checking for Google Play services updates, and verifying Android Device Policy installation.

  • TheAccountSetup class in the AMAPI SDK handles setting up a Google Account on a managed device, using an enrollment token and prompting for user authentication if needed.

  • The EMM uses user identifiers received after successful sign-in to set the device policy and mark the device as compliant using Play EMM API methods.

The Android Management API (AMAPI) SDK plays a important role in the new customDevice Policy Controller (DPC) enrollment flow. It facilitates communicationbetween EMM custom DPC apps and Android Device Policy (ADP) and streamlinesdevice enrollment by interacting with the Play EMM API for key enrollmentfunctions.

Key functions of the AMAPI SDK:

  • Enables communication between EMM DPC apps and Android Device Policy.
  • Facilitates local execution of commands.
  • Supports the new device enrollment flow for adding managed Google Accounts.
  • Manages the installation or updates of Android Device Policy when needed.

The SDK is essential for two primary reasons in the custom DPC enrollment flow:

  1. It sets the environment by helping to install and update Android DevicePolicy correctly on the device.

  2. It is used to call Android Device Policy locally, which initiates the userlogin sequence on the device.

These foundational functions prepare the device for management and make thesubsequent enrollment steps possible.


Environment

The AMAPI SDK'sEnvironmentClient is an interface that allows access toenvironment-related APIs. You can create an instance usingEnvironmentClientFactory.

Key features of theEnvironmentClient:

  • Makes sure the SDK API level meets the minimum requirement.
  • Checks for and initiates an update for Google Play services if needed.
  • Verifies that Android Device Policy is installed and updated. Be aware thatthis process can take some time as it may involve an installation or update.

For more details on theEnvironmentClient interface, see thereferencedocumentation.


AccountSetup

TheAccountSetup class within the AMAPI SDK is responsible for managing theprocess of setting up a Google Account on a managed Android device.

Key features of the AccountSetup:

  • Starts the account setup process using theAccountSetupClient and anenrollment token.
  • Handles the enrollment token, which is generated by the EMM and passed tothe AMAPI SDK. This token determines whether user authentication isrequired.
  • Launches an authentication activity if needed, prompting the user to signin with their Google credentials.
  • Receives a callback with the user's email and user ID upon successfulsign-in.
  • The EMM uses the received user identifiers to set the device policy with theDevices.update method.
  • The EMM callsDevices.setStateto mark the device as compliant and allow access to Google services.

This functionality is part of a new device enrollment method that leverages theAMAPI SDK instead of the DPC support library. For more details onAccountSetupseeAMAPI referencedocumentationandImplement the user accountsguide.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-25 UTC.