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
330
実践 脱Modifier.composed / Let's Modifier.Node
gya
2
710
タクシーアプリ『GO』Androidのリリースフロー / Release GO App
gya
0
1.3k
私の好きなModifier関数 / My Favorite Modifier
gya
0
870
2022年ヘルスケアアプリのつくり方 / 2022 A Healthcare App Odyssey
gya
0
1.3k
タクシーアプリ「GO」AndroidにできるところからJetpack Composeを入れている話 / Introduce Jetpack Compose gradually
gya
0
790
Gradle BOM importでライブラリバージョン管理 / DroidKaigi2019
gya
3
2k
Other Decks in Technology
See All in Technology
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
170
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
270
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
130
Wantedly での Datadog 活用事例
bgpat
1
500
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
220
普通のエンジニアがLaravelコアチームメンバーになるまで
avosalmon
0
100
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.5k
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
270
podman_update_2024-12
orimanabu
1
280
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Music & Morning Musume
bryan
46
6.2k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Gamification - CAS2011
davidbonilla
80
5.1k
Building an army of robots
kneath
302
44k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Unsuck your backbone
ammeep
669
57k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
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ʹΑͬͯΞϓϦͷৼΔ͍͕มΘΔΑ͏࣮