Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Firebaseで解決するAndroidの機種依存 / Firebase solve and...
Search
gyamoto
December 18, 2018
Technology
2
1.3k
Firebaseで解決するAndroidの機種依存 / Firebase solve android device difference
gyamoto
December 18, 2018
Tweet
Share
More Decks by gyamoto
See All by gyamoto
脱Accompanistを考える / Bye Accompanist
gya
0
350
実践 脱Modifier.composed / Let's Modifier.Node
gya
2
720
タクシーアプリ『GO』Androidのリリースフロー / Release GO App
gya
1
1.3k
私の好きなModifier関数 / My Favorite Modifier
gya
0
900
2022年ヘルスケアアプリのつくり方 / 2022 A Healthcare App Odyssey
gya
0
1.4k
タクシーアプリ「GO」AndroidにできるところからJetpack Composeを入れている話 / Introduce Jetpack Compose gradually
gya
0
800
Gradle BOM importでライブラリバージョン管理 / DroidKaigi2019
gya
3
2k
Other Decks in Technology
See All in Technology
新しいスケーリング則と学習理論
taiji_suzuki
10
3.8k
Kotlin Multiplatformのポテンシャル
recruitengineers
PRO
2
150
コロプラのオンボーディングを採用から語りたい
colopl
5
940
なぜfreeeはハブ・アンド・スポーク型の データメッシュアーキテクチャにチャレンジするのか?
shinichiro_joya
2
170
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
170
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
12k
🌏丸い地球を効率的に平たくする 〜🗺️地図の幾何学とWeb地図技術〜
syotasasaki593876
0
140
SpiderPlus & Co. エンジニア向け会社紹介資料
spiderplus_cb
0
840
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
190
re:Invent2024 KeynoteのAmazon Q Developer考察
yusukeshimizu
1
130
いま現場PMのあなたが、 経営と向き合うPMになるために 必要なこと、腹をくくること
hiro93n
9
7.2k
データ基盤におけるIaCの重要性とその運用
mtpooh
1
240
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Practical Orchestrator
shlominoach
186
10k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Building Adaptive Systems
keathley
38
2.4k
Agile that works and the tools we love
rasmusluckow
328
21k
The Cult of Friendly URLs
andyhume
78
6.1k
Unsuck your backbone
ammeep
669
57k
How STYLIGHT went responsive
nonsquared
96
5.3k
Documentation Writing (for coders)
carmenintech
67
4.5k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
GitHub's CSS Performance
jonrohan
1030
460k
Transcript
FirebaseͰղܾ͢Δ Androidͷػछґଘ Kohei Yamamoto
Kohei Yamamoto • ࣾձਓ4ͷAndroidΤϯδχΞ • ઈࢍDroidKaigi2019ͷൃද४උத • teamLabͰಇ͍͍ͯ·͢ • GitHubɿgyamoto
• Twitterɿfarundorl
Androidͷػछґଘ
ࠓճग़ձͬͨػछґଘ Bluetooth Low Energy (BLE) ͷΞυόλΠζΛ͓͜ͳ͏ͱɺ ग़ྗڧ[db]ͱΞυόλΠζִؒ[Hz]͕ػछʹΑͬͯҟͳΔ
Example: startAdvertising // val bleAdvertiser: BluetoothLeAdvertiser bleAdvertiser.startAdvertising( AdvertiseSettings.Builder() .setTxPowerLevel(ADVERTISE_TX_POWER_MEDIUM) .setAdvertiseMode(ADVERTISE_MODE_BALANCED)
.setConnectable(true) .build(), AdvertiseData.Builder() .build(), callback )
Example: startAdvertising // val bleAdvertiser: BluetoothLeAdvertiser bleAdvertiser.startAdvertising( AdvertiseSettings.Builder() .setTxPowerLevel(ADVERTISE_TX_POWER_MEDIUM) .setAdvertiseMode(ADVERTISE_MODE_BALANCED)
.setConnectable(true) .build(), AdvertiseData.Builder() .build(), callback ) ग़ྗڧΛ High, Medium, Low, UltraLow ͔Βઃఆ
Example: startAdvertising // val bleAdvertiser: BluetoothLeAdvertiser bleAdvertiser.startAdvertising( AdvertiseSettings.Builder() .setTxPowerLevel(ADVERTISE_TX_POWER_MEDIUM) .setAdvertiseMode(ADVERTISE_MODE_BALANCED)
.setConnectable(true) .build(), AdvertiseData.Builder() .build(), callback ) ΞυόλΠζִؒΛ LowLatency, Balanced, LowPower ͔Βઃఆ
BLEͷڧͱִ͕ؒػछґଘ • Xperiaܥ: ग़ྗ͕ऑ͍ • Galaxyܥ: ग़ྗΛ্͛ͳ͍ͱΞυόλΠζִ͕ؒ҆ఆ͠ͳ͍ • Huaweiܥ: ΞυόλΠζִ͕ؒ҆ఆͯ͠ͳ͍
※ Huaweiܥࠓճͷํ๏ͰղܾͰ͖ͳ͔ͬͨ
ػछґଘͷݏͳͱ͜Ζ ઃఆಉ͕ͩ͡ɺػछʹΑͬͯ࠷దͳग़ྗڧͱΞυόλΠζ ִ͔ؒΒΕͯ͠·͏ʢͱͯͭΒ͍ʣ ↓↓↓ ػछ͝ͱʹઃఆ͍͚ͨ͠ͲϋʔυίʔσΟϯάͨ͘͠ͳ͍ɻ Firebase UserProperty & RemoteConfigͰύϥϝʔλઃఆ
Firebase UserProperty & RemoteConfig
Firebase UserProperty • ݴޠҬͳͲϢʔβʔΛࣔ͢ଐੑΛઃఆͰ͖ΔϓϩύςΟ • RemoteConfigͳͲFirebaseͷଞαʔϏεͰϢʔβఆͷ ϑΟϧλϦϯάͱͯ͑͠Δ • ϓϩδΣΫτ͝ͱʹ25ݸ·ͰઃఆͰ͖Δ
Firebase RemoteConfig • ཧը໘Ͱઃఆͨ͠Λ৴͢ΔΈ • ΞϓϦ͔Βઃఆ͞ΕͨΛऔಘͯ͠ӬଓԽɺࢀরͰ͖Δ • ΞϓϦΛߋ৽ͤͣʹύϥϝʔλͷมߋA/BςετΛ࣮ݱ ͢ΔͨΊͷσʔλιʔε
UserProperty x RemoteConfig 1. ػछΛಛఆͰ͖ΔใΛUserPropertyʹઃఆ 2. UserProperty͔Βػछ͝ͱͷΛRemoteConfigʹઃఆ 3. RemoteConfigʹΑͬͯΞϓϦͷৼΔ͍͕มΘΔΑ͏࣮
1. ػछใΛUserPropertyʹઃఆ val analytics = FirebaseAnalytics.getInstance(context) // ໊(ྫ: Pixel 3,
SOV34, SC-01F, SHV39) analytics.setUserProperty("device_model", Build.MODEL) // ऀ໊(ྫ: Google, Sony, samsung, SHARP) analytics.setUserProperty(“device_manufacturer", Build.MANUFACTURER)
2. ػछ͝ͱͷΛRemoteConfigʹઃఆ
3. RemoteConfigʹΑͬͯৼΔ͍Λม͑Δ val config = FirebaseRemoteConfig.getInstance() init { // ύϥϝʔλ͝ͱʹσϑΥϧτΛઃఆ
config.setDefaults( "advertise_power" to ADVERTISE_TX_POWER_MEDIUM.toLong(), "advertise_mode" to ADVERTISE_MODE_BALANCED.toLong() ) }
3. RemoteConfigʹΑͬͯৼΔ͍Λม͑Δ val config = FirebaseRemoteConfig.getInstance() // ઃఆ͞ΕͨͷϑΣονɺ༗ޮԽ fun fetch()
{ config.fetch(cacheExpiration).addOnSuccessListener { config.activateFetched() } } val advertisePower: Int get() = config.getLong("advertise_power").toInt() val advertiseMode: Int get() = config.getLong("advertise_mode").toInt()
3. RemoteConfigʹΑͬͯৼΔ͍Λม͑Δ // RemoteConfigͷΛࢀর͢ΔΑ͏ʹஔ͖͑ bleAdvertiser.startAdvertising( AdvertiseSettings.Builder() .setTxPowerLevel(advertisePower) .setAdvertiseMode(advertiseMode) .setConnectable(true) .build(),
AdvertiseData.Builder() .build(), callback ) ϋʔυίʔσΟϯάɺΞϓϦͷߋ৽Λͤͣʹػछґଘʹཱ͔ͪ͏
FirebaseͰղܾ͢ΔAndroidͷػछґଘ 1. ػछΛಛఆͰ͖ΔใΛUserPropertyʹઃఆ 2. UserProperty͔Βػछ͝ͱͷΛRemoteConfigʹઃఆ 3. RemoteConfigʹΑͬͯΞϓϦͷৼΔ͍͕มΘΔΑ͏࣮