Android Management API (AMAPI) SDK를 사용하면 특정 앱이 Android Device Policy (ADP)와 직접 통신할 수 있습니다. 다음이 지원됩니다.
- 명령어의 로컬 실행
- 맞춤 DPC로 관리되는 기기를 AMAPI로 이전하기
- Device Trust from Android Enterprise
- 관리 Google 계정 추가도 지원하는 새 기기 등록 흐름
AMAPI SDK를 애플리케이션과 통합하려면 다음 단계를 따라야 합니다.
- AMAPI SDK 라이브러리를 추가합니다.
- 타겟 SDK가 30 이상인 경우 queries 요소를 추가합니다.
기본 요건
- 앱의
minSdkVersion
이(가) API 수준 21 이상으로 설정되어 있는지 확인합니다. - 최신 버전의 AMAPI SDK 종속 항목을 애플리케이션에 추가합니다. 사용 가능한 최신 라이브러리의 버전과 애플리케이션에 추가하는 방법은 AMAPI SDK 출시 노트 페이지에서 확인할 수 있습니다.
쿼리 요소 추가
앱이 SDK 30 이상을 타겟팅하는 경우 AndroidManifest.xml
에 queries 요소가 필요하여 ADP와 상호작용함을 지정해야 합니다.
<queries>
<package android:name="com.google.android.apps.work.clouddpc" />
</queries>
자세한 내용은 Android의 패키지 공개 상태 필터링을 참고하세요.
NotificationReceiverService 구현
일부 기능에는 NotificationReceiverService
를 만들어야 하고 일부 기능에서는 선택적으로 사용할 수 있습니다. 이를 사용하려면 NotificationReceiverService
를 확장하는 클래스를 정의하고 AndroidManifest.xml
에 service
로 추가한 후 내보내야 합니다.
import com.google.android.managementapi.notification.NotificationReceiverService;
...
public final class MyAppNotificationReceiverService extends NotificationReceiverService {
@Override
protected void setupInjection() {
// This method can be optionally used to inject dependencies at the
// beginning of the service lifecycle.
}
}
AndroidManifest.xml
에 다음을 추가합니다.
<service
android:name = ".MyAppNotificationReceiverService"
android:exported = "true" />
일반적으로 NotificationReceiverService
을 구현하는 클래스의 ComponentName
은 적절한 API를 통해 Google에 전달되어야 합니다.
세부정보는 문제의 기능에 따라 다르며, 이 기능이 필요한 각 기능은 이를 문서화합니다.