Stay organized with collections
Save and categorize content based on your preferences.
The Android Management API (AMAPI) SDK plays a important role in the new custom
Device Policy Controller (DPC) enrollment flow. It facilitates communication
between EMM custom DPC apps and Android Device Policy (ADP) and streamlines
device enrollment by interacting with the Play EMM API for key enrollment
functions.
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:
It sets the environment by helping to install and update Android Device
Policy correctly on the device.
It is used to call Android Device Policy locally, which initiates the user
login sequence on the device.
These foundational functions prepare the device for management and make the
subsequent enrollment steps possible.
Environment
The AMAPI SDK's EnvironmentClient is an interface that allows access to
environment-related APIs. You can create an instance using
EnvironmentClientFactory.
Key features of the EnvironmentClient:
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 that
this process can take some time as it may involve an installation or update.
The AccountSetup class within the AMAPI SDK is responsible for managing the
process of setting up a Google Account on a managed Android device.
Key features of the AccountSetup:
Starts the account setup process using the AccountSetupClient and an
enrollment token.
Handles the enrollment token, which is generated by the EMM and passed to
the AMAPI SDK. This token determines whether user authentication is
required.
Launches an authentication activity if needed, prompting the user to sign
in with their Google credentials.
Receives a callback with the user's email and user ID upon successful
sign-in.
The EMM uses the received user identifiers to set the device policy with the
Devices.update method.
The EMM calls Devices.setState
to mark the device as compliant and allow access to Google services.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Environment preparation and user enrollment\n\nThe Android Management API (AMAPI) SDK plays a important role in the new custom\nDevice Policy Controller (DPC) enrollment flow. It facilitates communication\nbetween EMM custom DPC apps and Android Device Policy (ADP) and streamlines\ndevice enrollment by interacting with the Play EMM API for key enrollment\nfunctions.\n\nKey functions of the AMAPI SDK:\n-------------------------------\n\n- Enables communication between EMM DPC apps and Android Device Policy.\n- Facilitates local execution of commands.\n- Supports the new device enrollment flow for adding managed Google Accounts.\n- Manages the installation or updates of Android Device Policy when needed.\n\nThe SDK is essential for two primary reasons in the custom DPC enrollment flow:\n\n1. It sets the environment by helping to install and update Android Device\n Policy correctly on the device.\n\n2. It is used to call Android Device Policy locally, which initiates the user\n login sequence on the device.\n\nThese foundational functions prepare the device for management and make the\nsubsequent enrollment steps possible.\n\n*** ** * ** ***\n\nEnvironment\n-----------\n\nThe AMAPI SDK's `EnvironmentClient` is an interface that allows access to\nenvironment-related APIs. You can create an instance using\n`EnvironmentClientFactory`.\n\n### Key features of the `EnvironmentClient`:\n\n- Makes sure the SDK API level meets the minimum requirement.\n- Checks for and initiates an update for Google Play services if needed.\n- Verifies that Android Device Policy is installed and updated. Be aware that this process can take some time as it may involve an installation or update.\n\nFor more details on the `EnvironmentClient` interface, see the [reference\ndocumentation](/android/management/reference/amapi/com/google/android/managementapi/environment/EnvironmentClient).\n\n*** ** * ** ***\n\nAccountSetup\n------------\n\nThe `AccountSetup` class within the AMAPI SDK is responsible for managing the\nprocess of setting up a Google Account on a managed Android device.\n\n### Key features of the AccountSetup:\n\n- Starts the account setup process using the `AccountSetupClient` and an enrollment token.\n- Handles the enrollment token, which is generated by the EMM and passed to the AMAPI SDK. This token determines whether user authentication is required.\n- Launches an authentication activity if needed, prompting the user to sign in with their Google credentials.\n- Receives a callback with the user's email and user ID upon successful sign-in.\n- The EMM uses the received user identifiers to set the device policy with the [`Devices.update`](/android/work/play/emm-api/v1/devices/update) method.\n- The EMM calls [`Devices.setState`](/android/work/play/emm-api/v1/devices/setState) to mark the device as compliant and allow access to Google services.\n\nThis functionality is part of a new device enrollment method that leverages the\nAMAPI SDK instead of the DPC support library. For more details on `AccountSetup`\nsee [AMAPI reference\ndocumentation](/android/management/reference/amapi/com/google/android/managementapi/accountsetup/package-summary)\nand [Implement the user accounts\nguide](/android/work/play/emm-api/implement-user-accounts)."]]