Przygotowanie środowiska i rejestracja użytkowników
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Pakiet SDK interfejsu Android Management API (AMAPI) odgrywa ważną rolę w nowym procesie rejestracji niestandardowego kontrolera zasad dotyczących urządzeń (DPC). Ułatwia komunikację między niestandardowymi aplikacjami DPC EMM a zasadami dotyczącymi urządzeń z Androidem (ADP) i usprawnia rejestrację urządzeń przez interakcję z interfejsem Play EMM API w zakresie kluczowych funkcji rejestracji.
Główne funkcje pakietu AMAPI SDK:
Umożliwia komunikację między aplikacjami DPC EMM a aplikacją Android Device Policy.
Ułatwia lokalne wykonywanie poleceń.
Obsługuje nowy proces rejestracji urządzeń w celu dodawania zarządzanych kont Google.
W razie potrzeby zarządza instalacją lub aktualizacjami aplikacji Android Device Policy.
Pakiet SDK jest niezbędny z 2 głównych powodów w przypadku niestandardowego procesu rejestracji DPC:
Ustawia środowisko, pomagając prawidłowo zainstalować i zaktualizować na urządzeniu aplikację Android Device Policy.
Służy do lokalnego wywoływania aplikacji Android Device Policy, która inicjuje sekwencję logowania użytkownika na urządzeniu.
Te podstawowe funkcje przygotowują urządzenie do zarządzania i umożliwiają wykonanie kolejnych kroków rejestracji.
Środowisko
EnvironmentClient pakietu AMAPI SDK to interfejs, który umożliwia dostęp do interfejsów API związanych z otoczeniem. Instancję możesz utworzyć za pomocą EnvironmentClientFactory.
Najważniejsze funkcje EnvironmentClient:
Sprawdza, czy poziom interfejsu API pakietu SDK spełnia minimalne wymagania.
Sprawdza, czy Usługi Google Play wymagają aktualizacji, i w razie potrzeby ją rozpoczyna.
Sprawdza, czy aplikacja Android Device Policy jest zainstalowana i zaktualizowana. Pamiętaj, że ten proces może potrwać, ponieważ może obejmować instalację lub aktualizację.
Klasa AccountSetup w pakiecie AMAPI SDK odpowiada za zarządzanie procesem konfigurowania konta Google na zarządzanym urządzeniu z Androidem.
Najważniejsze funkcje AccountSetup:
Rozpoczyna proces konfiguracji konta przy użyciu AccountSetupClient i tokena rejestracji.
Obsługuje token rejestracji, który jest generowany przez usługę EMM i przekazywany do pakietu AMAPI SDK. Ten token określa, czy wymagane jest uwierzytelnianie użytkownika.
W razie potrzeby uruchamia działanie uwierzytelniania, prosząc użytkownika o zalogowanie się przy użyciu danych logowania Google.
Otrzymuje wywołanie zwrotne z adresem e-mail i identyfikatorem użytkownika po pomyślnym zalogowaniu.
EMM używa otrzymanych identyfikatorów użytkownika do ustawiania zasad dotyczących urządzenia za pomocą metody Devices.update.
Usługa EMM wywołuje funkcję Devices.setState, aby oznaczyć urządzenie jako zgodne i umożliwić dostęp do usług Google.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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)."]]