Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ビジネス向けアプリを開発するときに知っておくべきAndroid Enterpriseの世界

Avatar for Yusaku Tanaka Yusaku Tanaka
September 15, 2023

ビジネス向けアプリを開発するときに知っておくべきAndroid Enterpriseの世界

Avatar for Yusaku Tanaka

Yusaku Tanaka

September 15, 2023
Tweet

More Decks by Yusaku Tanaka

Other Decks in Technology

Transcript

  1. Android Enterpriseって? Androidプラットフォームのビジネス利用を支えるために、 Googleが主導している取り組みのこと。 > Android Enterprise is a Google-led

    initiative to enable the use of Android devices and apps in the workplace.* 7 *https://developers.google.com/android/work/overview
  2. Android Enterpriseって? Androidプラットフォームのビジネス利用を支えるために、 Googleが主導している取り組みのこと。 > Android Enterprise is a Google-led

    initiative to enable the use of Android devices and apps in the workplace.* 10 *https://developers.google.com/android/work/overview
  3. Androidのビジネス利用 • 従業員への業務用デバイスの貸与 • 私用端末の持ち込み(BYOD, Bring Your Own Device) •

    専用端末(Kiosk) ◦ 飲食店の注文端末 ◦ 配送・在庫管理のハンドヘルドデバイス 11
  4. Androidのビジネス利用 • 従業員への業務用デバイスの貸与 • 私用端末の持ち込み(BYOD, Bring Your Own Device) •

    専用端末(Kiosk) ◦ 飲食店の注文端末 ◦ 配送・在庫管理のハンドヘルドデバイス -> デバイス単体でも実現可能だが、運用に課題が生じることもある 12
  5. ビジネス利用における課題の例 13 運用効率 セキュリティ プライバシー セットアップ 紛失による情報漏洩リスク 私物の持ち込み 問い合わせ・トラブル対応 悪意あるアプリの

    インストール 労働時間の管理 労働時間外の端末利用 *これらは一例で、企業や組織、ユースケースによって多様な課題が生じる
  6. デバイス管理(MDM) MDM (Mobile Device Management) 企業や組織におけるモバイルデバイス運用をより効率的かつ安全にするためのサービ スのこと。 EMM(Enterprise Mobility Management)と呼ばれることもある。

    Androidに限らず、iOSやWindowsなど他プラットフォームと併せてサポートしている 場合がある。 -> 今回はAndroidに限定した領域を扱う。 14
  7. Android Enterprise Recommended サードパーティ製MDMをGoogleが検証するプログラムのこと。 > It’s a shortlist of devices

    and service providers that meet Google’s strict enterprise requirements.*1 Android Enterprise Recommendedとして認定されたMDMサービスは、Android Enterprise公式のソリューションリストに掲載される*2。 18 *1. https://www.android.com/enterprise/recommended/ *2. https://androidenterprisepartners.withgoogle.com/emm/#!?aer
  8. 33 https://play.google.com/store/apps/details?id=com.google.a ndroid.apps.work.clouddpc Device Owner/Profile Owner権限を持 ちデバイス上でMDMクライアントとして振 る舞うアプリのことを Device Policy

    Controller(DPC) という。 現在のAndroid Enterpise*では、 Android Device Policyというアプリが DPCとして動作する。 特定のアプリ *以前は各MDMサービスがDPCを実装する必要があった https://github.com/googlesamples/android-testdpc
  9. Google Play • サーバーサイドで利用するAndroid Management APIは、Google Play servicesの一部として提供されている。 • これによって、Android

    Enterpriseの機能セット全てをMDMベンダーに対して標 準化して提供することができている。 • Managed Google Play*1によってインストール可能なアプリを制限したり、プライ ベートなアプリをGoogle Playでホストする*2機能も提供している。 38 *1.https://developers.google.com/android/management/apps#managed_google_pla y_iframe *2. https://developers.google.com/android/management/apps#private-apps
  10. Managed Configurations アプリ • Managed Configurationsの設定スキーマを定義 • Managed Configurationsを受け取る処理を実装 •

    Google Playでアプリを公開* MDM • Google Playから提供されるアプリ情報を元に設定UIを表示 • IT管理者が管理コンソールから設定を作成 43 *厳密にはこの限りではなく、 Google Playがホストするプライベートアプリでも利用可能
  11. Managed Configurations Android OS / Google Play • Google Play

    servicesがMDMサーバーからの設定変更を受ける*1 • Android OSのシステム領域に設定値をファイルとして保存*2 • RestrictionsManagerが設定値の取得をPlatform APIとして提供 44 *1 Android Management API ApplicationPolicy https://developers.google.com/android/management/reference/rest/v1/enterprises.policies#applicationpolicy *2 UserManagerService#writeApplicationRestrictionsLAr() https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/ android/server/pm/UserManagerService.java
  12. Managed Configurations アプリ • Managed Configurationsの設定スキーマを定義 • 設定値を受け取る処理の実装 • Google

    Playでアプリを公開 MDM • Google Playから設定スキーマを参照 • 管理コンソールから設定を作成 45
  13. Managed Configurations アプリ • Managed Configurationsの設定スキーマを定義 • 設定値を受け取る処理の実装 • Google

    Playでアプリを公開 MDM • Google Playから設定スキーマを参照 • 管理コンソールから設定を作成 46
  14. Managed Configurations アプリ • Managed Configurationsの設定スキーマを定義 • 設定値を受け取る処理の実装 • Google

    Playでアプリを公開 MDM • Google Playから設定スキーマを参照 • 管理コンソールから設定を作成 52
  15. 設定値を受け取る val manager = activity.getSystemService( Context.RESTRICTIONS_SERVICE) as RestrictionsManager val restrictions

    = manager.applicationRestrictions <: return val myFeatureEnabled = if (restrictions.containsKey("my_feature_enabled")) { restrictions.getBoolean("my_feature_enabled") } else { defaultValue } doSomething(myFeatureEnabled) 53 https://developer.android.com/reference/android/content/RestrictionsManager
  16. 設定値を受け取る val manager = activity.getSystemService( Context.RESTRICTIONS_SERVICE) as RestrictionsManager val restrictions

    = manager.applicationRestrictions <: return val myFeatureEnabled = if (restrictions.containsKey("my_feature_enabled")) { restrictions.getBoolean("my_feature_enabled") } else { defaultValue } doSomething(myFeatureEnabled) 54 https://developer.android.com/reference/android/content/RestrictionsManager
  17. 設定値を受け取る val manager = activity.getSystemService( Context.RESTRICTIONS_SERVICE) as RestrictionsManager val restrictions

    = manager.applicationRestrictions <: return val myFeatureEnabled = if (restrictions.containsKey("my_feature_enabled")) { restrictions.getBoolean("my_feature_enabled") } else { defaultValue } doSomething(myFeatureEnabled) 55 https://developer.android.com/reference/android/content/RestrictionsManager
  18. 設定値を受け取る val manager = activity.getSystemService( Context.RESTRICTIONS_SERVICE) as RestrictionsManager val restrictions

    = manager.applicationRestrictions <: return val myFeatureEnabled = if (restrictions.containsKey("my_feature_enabled")) { restrictions.getBoolean("my_feature_enabled") } else { defaultValue } doSomething(myFeatureEnabled) 56 https://developer.android.com/reference/android/content/RestrictionsManager
  19. 設定値を受け取る val manager = activity.getSystemService( Context.RESTRICTIONS_SERVICE) as RestrictionsManager val restrictions

    = manager.applicationRestrictions <: return val myFeatureEnabled = if (restrictions.containsKey("my_feature_enabled")) { restrictions.getBoolean("my_feature_enabled") } else { defaultValue } doSomething(myFeatureEnabled) 57 https://developer.android.com/reference/android/content/RestrictionsManager
  20. val restrictionsFilter = IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED) val restrictionsReceiver = object : BroadcastReceiver()

    { override fun onReceive(context: Context, intent: Intent) { </ ここでRestrictionsManagerからの設定値の取得などを行う } } registerReceiver(restrictionsReceiver, restrictionsFilter) 58
  21. Managed Configurationsの設定 67 <?xml version="1.0" encoding="utf-8"?> <restrictions xmlns:android=<<. <restriction android:key=<<.

    android:title=<<. android:description=<<. android:restrictionType=<<. <> </restrictions>
  22. Managed Configurationsの設定 68 <?xml version="1.0" encoding="utf-8"?> <restrictions xmlns:android=<<. <restriction android:key=<<.

    android:title=<<. android:description=<<. android:restrictionType=<<. <> </restrictions>
  23. 70 [ { "toplevel_name": "sample" }, { "name": "DroidKaigi", "url":

    "droidkaigi.jp" } ] Chrome for Android への反映
  24. • MDMはデバイスを効率的かつ安全に運用するためのサービス • Android EnterpriseとしてMDMの機能が標準化されている ◦ サーバーサイド:Android Management API ◦

    クライアント:Android Device Policy(DPC), Device Policy Manager • MDMを提供するためにGoogle Playが重要な役割を果たしている ◦ 自動インストールのようなGoogle Playストアのビジネス向け機能の提供 ◦ サーバーとクライアントの連携 まとめ 1/2 80
  25. • Managed Configurations や Connected Appsによって特殊なユースケース へ対応することができる • Managed Configurations

    ◦ IT管理者がアプリの設定をリモートで配布できる機能 ◦ アプリ側の実装のみで対応が可能 • Connected Apps ◦ 仕事用プロファイルと個人用プロファイルの間をアプリが通信できる機能 ◦ アーリーアクセスプログラムのため、実装方法や公開手順には注意が必要 まとめ 2/2 81
  26. • https://www.android.com/enterprise/management • https://developers.google.com/android/work/requirements • https://androidenterprisepartners.withgoogle.com/glossary/emm • https://developers.google.com/android/management • https://developer.android.com/work/managed-configurations

    • https://developer.android.com/reference/android/content/RestrictionsManager • https://developer.android.com/reference/android/app/admin/DevicePolicyManager • https://source.android.com/docs/devices/admin/managed-profiles • https://github.com/googlesamples/android-testdpc • https://developers.google.com/android/work/terminology Appendix 82