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
Hands-on with Android Wear
Search
Breandan Considine
July 31, 2015
Programming
0
69
Hands-on with Android Wear
A beginners guide to getting up and running with Android Wear.
Breandan Considine
July 31, 2015
Tweet
Share
More Decks by Breandan Considine
See All by Breandan Considine
Intrinsic social motivation via causal influence in multi-agent RL
breandan
0
110
Deep, Skinny Neural Networks are not Universal Approximators
breandan
0
110
PRM-RL: Long-range Robotic Navigation Tasks by Combining Reinforcement Learning and Sampling-based Planning
breandan
0
130
DeepTest: Automated Testing of Deep-Neural-Network-driven Autonomous Cars
breandan
0
100
Idiolect: A Reconfigurable Voice Coding Assisant
breandan
0
200
Interactive Programming with Automated Reasoning
breandan
0
69
Learning Structural Edits via Incremental Tree Transformations
breandan
0
50
Thinking Like Transformers
breandan
0
82
Discriminative Embeddings of Latent Variable Models for Structured Data
breandan
0
52
Other Decks in Programming
See All in Programming
RDoc meets YARD
okuramasafumi
2
130
WebAssemblyインタプリタを書く ~Component Modelを添えて~
ruccho
1
910
私の後悔をAWS DMSで解決した話
hiramax
4
140
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
730
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
2.6k
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
1
2.1k
CSC305 Summer Lecture 06
javiergs
PRO
0
100
Laravel Boost 超入門
fire_arlo
1
130
為你自己學 Python - 冷知識篇
eddie
1
160
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
2
1.4k
兎に角、コードレビュー
mitohato14
0
150
あのころの iPod を どうにか再生させたい
orumin
2
2.5k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
338
57k
It's Worth the Effort
3n
187
28k
Practical Orchestrator
shlominoach
190
11k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
GitHub's CSS Performance
jonrohan
1031
460k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
How to Ace a Technical Interview
jacobian
279
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Bash Introduction
62gerente
614
210k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Transcript
Hands-on with Breandan Considine JetBrains, Inc. AnDevCon Boston ‘15
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Wearable Data Layer (Play Services) • Communication channel between handheld
and wearables • Google Play Services behind the scenes • Provides three API for communication • Data Layer API • Node Layer API • Message Layer API
Android Wear Communication Mobile App Google Play Services Wear App
Data Layer Node Layer Message
Wearable Data Layer API (Play Services) • All wearable communication
starts with the GoogleApiClient apiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(Wearable.API) .build();
Wearable Data Layer API @Override protected void onStart() { super.onStart();
apiClient.connect(); } @Override protected void onStop() { apiClient.disconnect(); super.onStop(); }
@Override public void onConnected(Bundle bundle) { Wearable.DataApi.addListener(apiClient, this); Wearable.MessageApi.addListener(apiClient, this);
Wearable.NodeApi.addListener(apiClient, this); } @Override protected void onPause() { super.onPause(); Wearable.DataApi.removeListener(apiClient, this); … } Listeners and Callbacks
// Sender Wearable.MessageApi.sendMessage(apiClient, transcriptionNodeId, PATH, byteArray); // Listener public void
onMessageReceived(MessageEvent me) { if (me.getPath().equals(PATH)){ … } } Message API • One-way communication channel between local and remote node
PendingResult<NodeApi.GetConnectedNodesResult> nodes = Wearable.NodeApi.getConnectedNodes(mGoogleApiClient); @Override public void onPeerConnected(Node node) {…}
@Override public void onPeerDisconnected(Node node) {…} Node API
PendingResult<CapabilityApi.GetCapabilityResult> capability = Wearable.CapabilityApi.getCapability( mGoogleApiClient, VOICE_TRANSCRIPTION_CAPABILITY_NAME, CapabilityApi.FILTER_REACHABLE); @Override public void
onCapabilityChanged(CapabilityInfo info) {…} <?xml version="1.0" encoding="utf-8"?> <resources> <string-array name="android_wear_capabilities"> <item>voice_transcription</item> </string-array> </resources> Capability API
Voice Actions • Like handheld, launching a wear app defaults
to android:label <activity android:name=".WearActivity" android:label="WearActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> … </activity>
Special Thanks