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
290
実践 脱Modifier.composed / Let's Modifier.Node
gya
2
700
タクシーアプリ『GO』Androidのリリースフロー / Release GO App
gya
0
1.3k
私の好きなModifier関数 / My Favorite Modifier
gya
0
850
2022年ヘルスケアアプリのつくり方 / 2022 A Healthcare App Odyssey
gya
0
1.3k
タクシーアプリ「GO」AndroidにできるところからJetpack Composeを入れている話 / Introduce Jetpack Compose gradually
gya
0
780
Gradle BOM importでライブラリバージョン管理 / DroidKaigi2019
gya
3
2k
Other Decks in Technology
See All in Technology
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
1
210
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
470
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
ハイパーパラメータチューニングって何をしているの
toridori_dev
0
140
Lexical Analysis
shigashiyama
1
150
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
590
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
300
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Code Reviewing Like a Champion
maltzj
520
39k
Building Your Own Lightsaber
phodgson
103
6.1k
For a Future-Friendly Web
brad_frost
175
9.4k
Practical Orchestrator
shlominoach
186
10k
Ruby is Unlike a Banana
tanoku
97
11k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Gamification - CAS2011
davidbonilla
80
5k
It's Worth the Effort
3n
183
27k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
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ʹΑͬͯΞϓϦͷৼΔ͍͕มΘΔΑ͏࣮