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
67
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
79
Deep, Skinny Neural Networks are not Universal Approximators
breandan
0
74
PRM-RL: Long-range Robotic Navigation Tasks by Combining Reinforcement Learning and Sampling-based Planning
breandan
0
98
DeepTest: Automated Testing of Deep-Neural-Network-driven Autonomous Cars
breandan
0
77
Idiolect: A Reconfigurable Voice Coding Assisant
breandan
0
100
Interactive Programming with Automated Reasoning
breandan
0
55
Learning Structural Edits via Incremental Tree Transformations
breandan
0
26
Thinking Like Transformers
breandan
0
62
Discriminative Embeddings of Latent Variable Models for Structured Data
breandan
0
23
Other Decks in Programming
See All in Programming
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
最新TCAキャッチアップ
0si43
0
140
RubyLSPのマルチバイト文字対応
notfounds
0
120
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
役立つログに取り組もう
irof
28
9.6k
Better Code Design in PHP
afilina
PRO
0
130
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
920
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Featured
See All Featured
Bash Introduction
62gerente
608
210k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Thoughts on Productivity
jonyablonski
67
4.3k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
Visualization
eitanlees
145
15k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
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