Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Managed Configurations - Enterprise向け設定機能を知る
Search
Yusaku Tanaka
March 02, 2023
Technology
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Managed Configurations - Enterprise向け設定機能を知る
DeNA.apk #4
Yusaku Tanaka
March 02, 2023
More Decks by Yusaku Tanaka
See All by Yusaku Tanaka
ビジネス向けアプリを開発するときに知っておくべきAndroid Enterpriseの世界
imsaku
1
4k
Jetpack Compose Pagerを触ってみよう
imsaku
0
1.8k
Other Decks in Technology
See All in Technology
KPIだけでは評価できないプロダクトが考えるべき Evalsという第二の評価系 / Beyond KPIs: Evals as a Second Evaluation Framework for Products #PdEConf
aki_iinuma
4
3.9k
薬剤師(ドメインエキスパート)と一緒に育てる薬局向けAIアシスタント
kakehashi
PRO
2
140
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
1
310
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
260
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
360
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
310
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
190
Amazon Quick on DesktopがIAM Identity Centerで動かない理由
yukiogawa
0
150
日経電子版を支えていく Kasane Design System/fec_fukuoka
nikkei_engineer_recruiting
0
610
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
630
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
320
Redmine 7.0で私が開発した新機能の狙いと背景
vividtone
1
150
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
220
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
270
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Abbi's Birthday
coloredviolet
3
9.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Site-Speed That Sticks
csswizardry
13
1.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
WCS-LA-2024
lcolladotor
0
820
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.7k
Transcript
Managed Configurations Enterprise 向けの設定機能を知る 2023-03-02 DeNA.apk #4 Yusaku Tanaka (@imsaku)
About me Yusaku Tanaka (@imsaku) DeNA Co., Ltd. Android Enterprise
にちょっとだけ詳しい https://g.dev/imsaku Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 2
今回話すこと Managed Configurations って何... ? サンプルコードとその説明 Managed Configurations - Enterprise
向けの設定機能を知る Yusaku Tanaka (@imsaku) 3
Managed Configurations って ... ? 管理された Android デバイス上の、 Managed Configurations
が実装されたアプリに対して、 IT 管理者が、 設定値を配布できる機能。 Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 4
管理された Android デバイス モバイルデバイスを管理するための製品・サービスが存在する MDM (Mobile Device Management) EMM (Enterprise
Mobility Management) 例) Google Workspace のエンドポイント管理機能 ユースケース 会社が所有しているデバイスを従業員に配布する 従業員個人が所有しているデバイスを業務で利用する(BYOD ) Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 5
IT 管理者 企業の情報システム部門担当者など 一般的に、MDM/EMM が提供するWeb 上の管理画面からデバイス を管理する 例)Google Workspace の管理コンソールから、デバイスのセキ
ュリティポリシーを定めたり、業務で使用するアプリを自動イン ストールしたりする Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 6
設定値の配布 Managed Configurations の機能そのもの 例えば... ブラウザアプリで、従業員向けのページをまとめたブックマークフ ォルダを配布する 業務用のアプリで、一部機能を有効化・無効化する 例)Chrome https://chromeenterprise.google/policies/
Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 7
アプリ側がやること 3 つだけ。 設定のスキーマをXML で定義する 設定値を RestrictionsManager から取得する 設定値の変更を BroadcastReceiver
で検知する MDM/EMM 側とはどうやってやり取りするの・・・? → Google Play が提供するAPI を通じて、MDM/EMM 側がスキーマの 取得や設定値の配布を行なってくれる。 Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 8
設定のスキーマを定義する AndroidManifest.xml Managed Configurations の使用を宣言する。 <application> <meta-data android:name="android.content.APP_RESTRICTIONS" android:resource="@xml/app_restrictions" />
... Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 9
設定のスキーマを定義する res/xml/app_restrictions.xml res/xml に app_restrictions.xml を作成し、構成を定義する。 <?xml version="1.0" encoding="utf-8"?> <restrictions
xmlns:android="http://schemas.android.com/apk/res/android"> <restriction android:key="my_feature_enabled" android:restrictionType="bool" android:defaultValue="false" android:title="@string/title_my_feature" android:description="@string/description_my_feature"/> <restriction ... /> ... Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 10
設定のスキーマを定義する app_restrictions.xml で使用する主な属性値 Attribute Description android:key 設定値を識別するKey android:restrictionType 設定値の型 android:defaultValue
デフォルト値 android:title MDM 側に表示するタイトル android:description MDM 側に表示する説明文 Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 11
設定のスキーマを定義する android:restrictionType でサポートされている主な型 Type Description bool true, false のbool 値
string 文字列 integer int 型の整数値 choice 単一選択のリスト multi-select 複数選択可能なリスト bundle, bundle-array 設定をネストするためのBundle やその配列 Managed Configurations - Enterprise 向けの設定機能を知る 12
設定値を取得する 設定値はGoogle Play services を介してAndroid デバイスに保存され る アプリはシステムサービスの RestrictionsManager を使って、任意の
タイミングで設定値を Bundle として受け取ることができる android:defaultValue が Bundle に含まれているとは限らない Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 13
設定値を取得する val manager = activity.getSystemService( Context.RESTRICTIONS_SERVICE) as RestrictionsManager // applicationRestrictions
はBundle? 型 val restrictions = manager.applicationRestrictions ?: return // android:key を指定して設定値を取得する val myFeatureEnabled = if (restrictions.containsKey("my_feature_enabled")) { restrictions.getBoolean("my_feature_enabled") } else { defaultValue } // 設定値を元にビジネスロジックを処理する doSomething(myFeatureEnabled) Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 14
設定値の変更を検知する アプリの実行中に設定値が変更された場合は、 BroadcastReceiver で変更通知を受け取ることができる このとき BroadcastReceiver はmanifest-declared ではなく、 context-registered である必要がある
AndroidManifest.xml に宣言するのではなく、Context から動的 に登録する必要がある Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 15
設定値の変更を検知する class RestrictionsReceiver : BroadcastReceiver() { override fun onReceive(context: Context,
intent: Intent) { // 設定値の取得や設定変更に伴うビジネスロジックの処理 } } val receiver = RestrictionsReceiver() val intentFilter = IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED) registerReceiver(receiver, intentFilter) Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 16
より具体的な内容に興味のある人は ... Google のサンプルを利用してローカルで試すことができる 1. TestDPC*1 で管理されたAndroid デバイスをセットアップする Google Play
ストアからインストール可能 2. Managed Configurations のサンプルアプリ*2 をインストール 自分で同様のアプリを実装してもOK 3. 2. でインストールしたアプリの設定をTestDPC で変更する *1: https://github.com/googlesamples/android-testdpc *2: https://github.com/android/enterprise-samples/tree/main/ManagedConfigurations Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 17
まとめ MDM/EMM との併用を前提としたEnterprise 特化の設定機能を実装 できる 設定のスキーマや実際の設定値はGoogle Play を介してAndroid デバ イスとMDM/EMM
の間でやりとりされる アプリ側では、RestrictionsManager からBundle として設定値を取 得したり、BroadcastReceiver で設定値の変更を受信したりできる Managed Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 18
参考資料 https://developer.android.com/work/managed-configurations https://developer.android.com/reference/android/content/Restrict ionsManager https://developer.android.com/reference/android/content/Restrict ionEntry https://github.com/android/enterprise-samples https://developers.google.com/android/management/managed- configurations-iframe Managed
Configurations - Enterprise 向けの設定機能を知る Yusaku Tanaka (@imsaku) 19
Managed Configurations Enterprise 向けの設定機能を知る 2023-03-02 DeNA.apk #4 Yusaku Tanaka (@imsaku)