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
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.7k
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
320
Taming you application's environments
salaboy
0
190
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
10
1.1k
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
540
日経電子版のStoreKit2フルリニューアル
shimastripe
1
140
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
180
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
Featured
See All Featured
Side Projects
sachag
452
42k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Fireside Chat
paigeccino
34
3k
The Language of Interfaces
destraynor
154
24k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
KATA
mclloyd
29
14k
Bash Introduction
62gerente
608
210k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Making Projects Easy
brettharned
115
5.9k
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ʹΑͬͯΞϓϦͷৼΔ͍͕มΘΔΑ͏࣮