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
既存アプリを1時間でWear対応する
Search
Taro Nagasawa
July 16, 2014
Programming
2
5.5k
既存アプリを1時間でWear対応する
Android Wear勉強会 #2 (
http://atnd.org/events/53398
)の発表資料です。
Taro Nagasawa
July 16, 2014
Tweet
Share
More Decks by Taro Nagasawa
See All by Taro Nagasawa
Android開発者のための Kotlin Multiplatform入門
ntaro
0
370
Kotlin 最新動向2022 #tfcon #techfeed
ntaro
1
2.1k
#Ubie 狂気の認知施策と選考設計
ntaro
13
12k
UbieにおけるサーバサイドKotlin活用事例
ntaro
1
1.1k
KotlinでSpring 完全理解ガイド #jsug
ntaro
6
3.3k
Kotlinでサーバサイドを始めよう!
ntaro
1
920
Androidからサーバーサイドまで!プログラミング言語 Kotlinの魅力 #devboost
ntaro
5
2.6k
Kotlin Contracts #m3kt
ntaro
4
3.8k
How_to_Test_Server-side_Kotlin.pdf
ntaro
1
430
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Contemporary Test Cases
maaretp
0
140
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
CSC509 Lecture 12
javiergs
PRO
0
160
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
subpath importsで始めるモック生活
10tera
0
320
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.8k
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
Vapor Revolution
kazupon
1
150
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
210
Realtime API 入門
riofujimon
0
150
イマのCSSでできる インタラクション最前線 + CSS最新情報
clockmaker
3
350
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
65
11k
Gamification - CAS2011
davidbonilla
80
5k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Designing for Performance
lara
604
68k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
BBQ
matthewcrist
85
9.3k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Speed Design
sergeychernyshev
25
620
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Code Reviewing Like a Champion
maltzj
520
39k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Transcript
طଘΞϓϦΛ࣌ؒͰ 8FBSରԠ͢Δ ᖒଠ!OHTX@UBSP
ࣗݾհ w ᖒଠ!OHTX@UBSP w ιϑτΣΞΤϯδχΞ w ࣗশ,PUMJOΤόϯδΣϦετ
झຯͰ։ൃͯ͠ΔΞϓϦ ເͱຐ๏ͷͪ࣌ؒ ເͱຐ๏ͷԦࠃͷͪ࣌ؒ ΛνΣοΫ͢ΔΞϓϦͰ͢ɻ ! ɾສμϯϩʔυ ɾฏۉධՁ ɾ௨ʗΟδΣοτରԠ (PPHMF1MBZΑΓ%-Մ IUUQHPPHM0L)OH
8FBSରԠ͠·ͨ͠
طଘΞϓϦΛ࣌ؒͰ 8FBSରԠ͢Δ
طଘΞϓϦΛ࣌ؒͰ 8FBSରԠ͢Δ ͱʹ͔͘ૣ͘ϦϦʔε ڽͬͨػೳޙճ͠
w௨ฤ w8FBSΞϓϦฤ
·ͣ࢝Ίʹ DPNQJMFDPNBOESPJETVQQPSUBQQDPNQBUW DPNQJMFDPNHPPHMFBOESPJEHNTQMBZTFSWJDFT طଘΞϓϦͷCVJMEHSBEMFͰґଘؔΛߋ৽ ͜͜·Ͱ
௨ฤ
௨Կ͠ͳͯ͘ 8FBSʹදࣔ͞ΕΔΑ
ྫ*OCPY4UZMF
ྫ*OCPY4UZMF ଞʹΞΫγϣϯϘλϯ উखʹ8FBSଆʹදࣔ͞ΕΔ
͙͢ʹͰ͖Δ؆୯ͳରԠ w എܠը૾Λઃఆ w ϖʔδΛՃ w ௨ΛελοΫ͢Δ w ରԠ͠ͳ͍
8FBS༻௨ઃఆͷྲྀΕ WearableExtenderΠϯελϯεΛੜ͢Δ WearableExtenderʹରͯ͠ઃఆΛ͢Δ NotificationCompat.Builder#extendͰ WearableExtenderΛηοτ͢Δ NotificationManagerCompatΛͬͯ௨Λ
ൃߦ͢Δ
8FBS༻௨ઃఆͷྲྀΕ WearableExtenderΠϯελϯεΛੜ͢Δ WearableExtenderʹରͯ͠ઃఆΛ͢Δ NotificationCompat.Builder#extendͰ WearableExtenderΛηοτ͢Δ NotificationManagerCompatΛͬͯ௨Λ
ൃߦ͢Δ
എܠը૾ͷઃఆ wearableExtender.setBackground(bitmap); -BSHFU*DPOΛ֦େͨͭ͠ ΦϦδφϧαΠζ
ϖʔδΛՃ wearableExtender! .addPage(notification)! .addPages(notificationList); DPOUFOU5JUMF DPOUFOU5FYU
௨ΛελοΫ͢Δ notificationCompatBuilder! ! .setGroup(“GroupKey”) ͜͜·Ͱ
8FBSΞϓϦฤ
8FBSΞϓϦՃͷྲྀΕ ϓϩδΣΫτʹ8FBSϞδϡʔϧΛՃ͢Δ 8FBSΞϓϦΛ࡞Δ ຊମϞδϡʔϧʹ8FBSϞδϡʔϧΛόϯυϧ͢Δ ઃఆΛՃ͢Δ Ϗϧυͯ͠ຊମͷBQLΛެ։
8FBSϞδϡʔϧՃ 8FBSΞϓϦΛՃ͍ͨ͠ϓϩδΣΫτΛ "OESPJE4UVEJPͰ։͘ 'JMF/FX.PEVMF Οβʔυ͕ग़ΔͷͰ8FBS༻ʹઃఆ͢Δ
None
None
None
CVJMEHSBEMFͷमਖ਼ DPNQJMF4EL7FSTJPO8 DPNQJMF4EL7FSTJPO ͜͜·Ͱ
8FBSΞϓϦΛ࡞Δ w ຊମΞϓϦ͔ΒσʔλΛड͚औΔ w σʔλΛදࣔ͢Δ ϏϡʔΛ࡞Δ
ຊମΞϓϦ͔ΒσʔλΛड͚औΔ w ڞ௨Ͱ͏Ϋϥε܈ΛϞδϡʔϧʹ͚Δ w ྫ͑"UUSBDUJPOΫϥεͳͲ w ϝοηʔδΛΓऔΓ͢Δ
Ϟδϡʔϧ͚ ྫ w BQQϞδϡʔϧిʗλϒϨοτ༻ΞϓϦ w XFBSϞδϡʔϧ8FBS༻ΞϓϦ w DPNNPOϞδϡʔϧڞ௨σʔλɺϩδοΫͳͲ BQQͱXFBSDPNNPOʹґଘ͢Δ ͜͜·Ͱ
ϝοηʔδΛΓऔΓ͢Δ ৽͍ͪ࣌ؒ͠ใΛཁٻ ͪ࣌ؒใΛฦ͢
ϝοηʔδૹ৴"1* Wearable.NodeApi#getConnectedNodes Wearable.MessageApi#sendMessage Ͱଓ͍ͯ͠ΔϊʔυΛऔಘͯ͠ ͰϝοηʔδΛૹ৴͢Δ Wearable.NodeApi.getConnectedNodes(googleApiClient).setResultCallback(! new ResultCallback<NodeApi.GetConnectedNodesResult>() {! @Override!
public void onResult(final NodeApi.GetConnectedNodesResult nodes) {! for (final Node node : nodes.getNodes()) {! Wearable.MessageApi.sendMessage(client, node.getId(), path, data);! }! }! }! );
ϝοηʔδͷड৴ w MessageApi.MessageListenerΠϯλϑΣʔε Λ࣮͢Δ ! w WearableListenerServiceͷαϒΫϥεΛ࡞ͬ ͯΠϯςϯτΛर͏ PS
ϝοηʔδͷ༰CZUFྻ ΦϒδΣΫτΛੜͯ͠CZUFྻʹม ArrayList<Attraction>ˠbyte[] CZUFྻΛड৴ͯ͠ΦϒδΣΫτʹม byte[]ˠArrayList<Attraction> ͜͜·Ͱ
ϝοηʔδ"1*ͷৄࡉ ! IUUQEFWFMPQFSBOESPJEDPNJOUMKBUSBJOJOH XFBSBCMFTEBUBMBZFSJOEFYIUNM
ϏϡʔΛ࡞Δ w WearableListView8FBS༻ϦετϏϡʔ w GridViewPager(SJEͳ7JFX1BHFS w CardFragmentΧʔυܕϑϥάϝϯτ
8FBSBCMF-JTU7JFX w 8FBSBCMF-JTU7JFX"EBQUFS w 8FBSBCMF-JTU7JFX༻Ξμϓλ w 7JFX)PMEFSΛཧͯ͘͠ΕΔͬΆ͍ ˡ8FBSBCMF-JTU7JFX༻
(SJE7JFX1BHFS $BSE'SBHNFOU w ্ԼࠨӈʹεϫΠϓҠಈͰ͖Δϖʔδϟ w $BSE'SBHNFOU؆୯ʹઃஔՄೳ CardFragment.create(“title",! “description",! R.drawable.ic_launcher); 2JJUBʮ8FBS༻7JFXͷ(SJE7JFX1BHFSΛ͏ʯ
IUUQRJJUBDPNOHTX@UBSPJUFNTCBFGB ͜͜·Ͱ
8FBSϞδϡʔϧΛόϯυϧ w BQQϞδϡʔϧిʗλϒϨοτ༻ΞϓϦ w XFBSϞδϡʔϧ8FBS༻ΞϓϦ BQQϞδϡʔϧͷCVJMEHSBEMF dependencies {! ɾɾɾ! wearApp
project(‘:wear')! } ͜͜·Ͱ
Ϗϧυͯ͠ຊମͷBQLΛެ։ w #VJMEˠ(FOFSBUF4JHOFE"1,ʜ w BQQϞδϡʔϧ ຊମϞδϡʔϧ Λબ w BQQSFMFBTFBQLΛిʹΠϯετʔϧ͢Δͱଓ ͍ͯ͠Δ8FBSʹXFBSΞϓϦ͕ࣗಈతʹΠϯε
τʔϧ͞ΕΔ w BQQSFMFBTFBQLΛσϕίϯʹΞοϓͯ͠ެ։ ͜͜·Ͱ
༨ͬͨʂ
ৄ͍͠จݙ w "OESPJE%FWFMPQFST w μϯϩʔυͰ͖Δ"1*ϦϑΝϨϯε w 4%,ಉࠝͷαϯϓϧ IUUQEFWFMPQFSBOESPJEDPNJOUMKBUSBJOJOHCVJMEJOHXFBSBCMFTIUNM IUUQEFWFMPQFSBOESPJEDPNJOUMKBUSBJOJOHXFBSBCMFTBQQTMBZPVUTIUNM6J-JCSBSZ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ