About the Author |
|
xix | |
About the Technical Reviewer |
|
xxi | |
Acknowledgments |
|
xxiii | |
|
|
1 | (16) |
|
Chapter 1 Introducing Android Wearables |
|
|
3 | (14) |
|
Wearables and Contextual Awareness |
|
|
3 | (1) |
|
Wearables and User Experience |
|
|
4 | (1) |
|
|
5 | (1) |
|
What Can Android Wear Do? |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
Understanding Glass Lingo |
|
|
10 | (3) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
The End of the Glass Explorers Program |
|
|
13 | (1) |
|
Should I Develop for Glass or Android Wear? |
|
|
13 | (1) |
|
|
14 | (1) |
|
|
14 | (1) |
|
|
15 | (2) |
|
|
17 | (76) |
|
Chapter 2 Reviewing Notifications for Android |
|
|
19 | (36) |
|
|
19 | (3) |
|
|
22 | (4) |
|
Always Use a Content Intent |
|
|
23 | (1) |
|
|
23 | (1) |
|
|
24 | (1) |
|
|
24 | (2) |
|
|
26 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
27 | (2) |
|
Notifications in Android 5.0 |
|
|
29 | (7) |
|
Dark Content on a Light Background |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
Lock Screen Notifications |
|
|
30 | (4) |
|
|
34 | (2) |
|
Changing a Notification's Color |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
36 | (6) |
|
BigTextStyle Notification |
|
|
37 | (1) |
|
BigPictureStyle Notification |
|
|
38 | (2) |
|
|
40 | (2) |
|
|
42 | (3) |
|
|
43 | (2) |
|
|
45 | (4) |
|
|
46 | (3) |
|
|
49 | (5) |
|
Implementing MediaStyleService |
|
|
49 | (4) |
|
Handle the Play and Pause Actions |
|
|
53 | (1) |
|
Implementing MainActivity |
|
|
54 | (1) |
|
|
54 | (1) |
|
Chapter 3 Customizing Notifications for Wearables |
|
|
55 | (38) |
|
|
55 | (1) |
|
|
56 | (2) |
|
Handheld Notifications on Wearables |
|
|
58 | (8) |
|
|
58 | (1) |
|
BigTextStyle Notifications |
|
|
59 | (2) |
|
BigPictureStyle Notifications |
|
|
61 | (2) |
|
|
63 | (1) |
|
|
64 | (2) |
|
Customizing Notifications for Wearables |
|
|
66 | (26) |
|
Wielding TaskStackBuilder |
|
|
66 | (5) |
|
|
71 | (4) |
|
|
75 | (4) |
|
|
79 | (4) |
|
|
83 | (4) |
|
Background Only Notifications |
|
|
87 | (3) |
|
|
90 | (2) |
|
|
92 | (1) |
|
|
93 | (180) |
|
Chapter 4 Running Apps Directly on Android Wear |
|
|
95 | (34) |
|
The Android SDK in Android Wear |
|
|
95 | (1) |
|
|
96 | (2) |
|
|
98 | (2) |
|
App-Provided Voice Actions |
|
|
99 | (1) |
|
System-Provided Voice Actions |
|
|
99 | (1) |
|
|
100 | (1) |
|
Example #1 Our First Wearable App |
|
|
100 | (2) |
|
|
102 | (1) |
|
Our First Wearable UI View: WearableListView |
|
|
102 | (12) |
|
WearableListView and RecyclerView |
|
|
103 | (1) |
|
|
103 | (1) |
|
Example #2 Implementing a List of Strings |
|
|
103 | (4) |
|
Example #3 Implementing an Animated WearableListView |
|
|
107 | (6) |
|
Implementing AnimatedListViewActivity |
|
|
113 | (1) |
|
Example #4 Creating a Timer App |
|
|
114 | (14) |
|
Overview of the Architecture |
|
|
115 | (2) |
|
|
117 | (4) |
|
Implementing CommandReceiver |
|
|
121 | (3) |
|
Implementing TimerCompletedActivity |
|
|
124 | (2) |
|
Implementing TimerActivity |
|
|
126 | (2) |
|
|
128 | (1) |
|
Chapter 5 Android Wear User Interface Essentials |
|
|
129 | (44) |
|
|
130 | (2) |
|
The Card Gravity Property |
|
|
130 | (1) |
|
The Card Expansion Property |
|
|
131 | (1) |
|
The Expansion Direction Property |
|
|
131 | (1) |
|
The Expansion Factor Property |
|
|
132 | (1) |
|
|
132 | (3) |
|
Example App #1 Vocab Builder |
|
|
135 | (7) |
|
Representing Vocabulary Words |
|
|
135 | (1) |
|
Representing a Vocabulary Word List |
|
|
136 | (2) |
|
Implementing VocabularyAdapter |
|
|
138 | (2) |
|
|
140 | (1) |
|
Creating and Populating GridViewPager |
|
|
141 | (1) |
|
|
142 | (1) |
|
Using DelayedConfirmationView |
|
|
143 | (5) |
|
|
146 | (1) |
|
|
146 | (1) |
|
Using ConfirmationActivity |
|
|
147 | (1) |
|
Example App #2 Confirmation Demo |
|
|
148 | (11) |
|
Implementing Action Buttons |
|
|
149 | (2) |
|
Creating a Fragment with an Action Button |
|
|
151 | (3) |
|
Implementing DelayedConfirmationActivity |
|
|
154 | (2) |
|
Implementing ConfirmationDemoActivity |
|
|
156 | (3) |
|
|
159 | (1) |
|
Example App #3 Running Stats |
|
|
160 | (4) |
|
|
160 | (4) |
|
Implementing RunStatsActivity |
|
|
164 | (3) |
|
Example App #4 Creating a Custom Notification |
|
|
167 | (4) |
|
Creating a Custom Notification |
|
|
168 | (2) |
|
Stopping the Custom Notification |
|
|
170 | (1) |
|
Starting the Custom Notification |
|
|
171 | (1) |
|
|
171 | (2) |
|
Chapter 6 The Wearable Data Layer API |
|
|
173 | (42) |
|
|
173 | (1) |
|
Connecting to GoogleApiClient |
|
|
174 | (7) |
|
Example #1 Establishing an Asynchronous Connection |
|
|
174 | (5) |
|
A Minimal Asynchronous Connection |
|
|
179 | (1) |
|
Establishing a Synchronous Connection |
|
|
180 | (1) |
|
|
181 | (1) |
|
Example #2 Using the Node API |
|
|
182 | (6) |
|
|
188 | (1) |
|
Example #3 Building a Shared Counter |
|
|
188 | (13) |
|
Implementing the Handheld Activity |
|
|
190 | (3) |
|
Implementing the Wearable Activity |
|
|
193 | (3) |
|
Sending Messages with the Message API |
|
|
196 | (1) |
|
Receiving Messages with the Message API |
|
|
197 | (1) |
|
Request Response Paradigm |
|
|
198 | (3) |
|
|
201 | (6) |
|
Implementing the Decrement and Increment Buttons |
|
|
205 | (2) |
|
Example #4 Sending and Receiving Assets |
|
|
207 | (6) |
|
Sending Assets with the Data API |
|
|
207 | (4) |
|
Retrieving Assets with the Data API |
|
|
211 | (2) |
|
|
213 | (2) |
|
Chapter 7 Creating Custom Watch Faces |
|
|
215 | (58) |
|
The Anatomy of a Watch Face |
|
|
216 | (6) |
|
Interactive and Ambient modes |
|
|
216 | (2) |
|
Low-bit Ambient Mods and Burn-in Protection |
|
|
218 | (2) |
|
|
220 | (1) |
|
The Moto 360 and the Bottom Inset |
|
|
220 | (1) |
|
|
221 | (1) |
|
|
221 | (1) |
|
Configuring the Watch Face Style |
|
|
222 | (1) |
|
|
223 | (7) |
|
|
224 | (1) |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
227 | (1) |
|
Hotword Indicator Gravity |
|
|
227 | (1) |
|
|
228 | (1) |
|
|
229 | (1) |
|
Building a Basic Watch Face |
|
|
230 | (1) |
|
Creating and Declaring a Watch Face |
|
|
230 | (15) |
|
Implementing the Engine Class |
|
|
233 | (6) |
|
Scaling the Watch Face to the Current Size |
|
|
239 | (1) |
|
|
240 | (5) |
|
Building a Watch Face from Bitmaps |
|
|
245 | (27) |
|
Encapsulating Bitmaps with WatchFaceBitmapHolder |
|
|
249 | (3) |
|
|
252 | (1) |
|
Implementing ConvergenceUtil |
|
|
253 | (3) |
|
Implementing ConvergenceWearableConfigActivity |
|
|
256 | (3) |
|
Implementing ConvergenceConfigActivity |
|
|
259 | (3) |
|
Implementing ConvergenceWearableListenerService |
|
|
262 | (2) |
|
Implementing ConvergenceWatchFaceService |
|
|
264 | (8) |
|
|
272 | (1) |
|
|
273 | (144) |
|
Chapter 8 Running Apps Directly on Glass |
|
|
275 | (20) |
|
The GDK and the Mirror API |
|
|
275 | (2) |
|
Should I use the Mirror API or the GDK? |
|
|
276 | (1) |
|
Immersions and Ongoing Tasks |
|
|
277 | (5) |
|
|
277 | (1) |
|
|
278 | (1) |
|
Combined Immersion and Ongoing Task |
|
|
279 | (1) |
|
|
280 | (2) |
|
|
282 | (1) |
|
Implementing an Immersion |
|
|
282 | (3) |
|
|
285 | (1) |
|
|
285 | (1) |
|
Implementing Scrolling Cards |
|
|
286 | (4) |
|
|
290 | (3) |
|
|
293 | (2) |
|
Chapter 9 Glass User Interface Essentials |
|
|
295 | (54) |
|
Building Cards Styled for Glass |
|
|
295 | (20) |
|
Declaring a Voice Command |
|
|
296 | (1) |
|
Extending CardScrollAdapter |
|
|
296 | (2) |
|
Creating the List of Scrolling Cards |
|
|
298 | (2) |
|
|
300 | (3) |
|
|
303 | (1) |
|
|
304 | (2) |
|
|
306 | (1) |
|
|
307 | (1) |
|
|
308 | (1) |
|
|
308 | (1) |
|
|
309 | (1) |
|
|
310 | (5) |
|
|
315 | (15) |
|
|
315 | (1) |
|
|
315 | (1) |
|
|
315 | (1) |
|
|
316 | (5) |
|
|
321 | (9) |
|
Implementing a Digital Speedometer |
|
|
330 | (11) |
|
Implementing DigitalSpeedView |
|
|
331 | (1) |
|
Implementing DigitalSpeedMenuActivity |
|
|
332 | (3) |
|
Implementing DigitalSpeedService |
|
|
335 | (2) |
|
Implementing DigitalSpeedRenderer |
|
|
337 | (2) |
|
Implementing RenderThread |
|
|
339 | (2) |
|
Displaying Progress and Status with Slider |
|
|
341 | (7) |
|
|
348 | (1) |
|
Chapter 10 Gesture and Voice Recognition |
|
|
349 | (32) |
|
|
349 | (17) |
|
Viewing Generic Motion Events |
|
|
350 | (4) |
|
|
354 | (1) |
|
Detecting Gestures and Counting Fingers |
|
|
355 | (3) |
|
Detecting Scrolling on the Touchpad |
|
|
358 | (6) |
|
Implementing Inertial Scroll |
|
|
364 | (2) |
|
|
366 | (8) |
|
|
368 | (1) |
|
Implementing HeadGestureDetector |
|
|
369 | (2) |
|
Implementing HeadGestureActivity |
|
|
371 | (3) |
|
|
374 | (5) |
|
|
375 | (1) |
|
Standalone Voice Recognition |
|
|
376 | (1) |
|
Contextual Voice Commands |
|
|
377 | (2) |
|
|
379 | (2) |
|
Chapter 11 The Camera: Taking Pictures and Recording Video |
|
|
381 | (36) |
|
Taking Pictures and Recording Videos with Intents |
|
|
382 | (1) |
|
|
382 | (1) |
|
|
383 | (1) |
|
Example #1 Capturing Media with Intents |
|
|
383 | (8) |
|
|
384 | (7) |
|
Example #2 Using the Camera API |
|
|
391 | (11) |
|
|
392 | (2) |
|
Implementing the SurfaceHolder Callback |
|
|
394 | (2) |
|
Implementing CameraActivity |
|
|
396 | (1) |
|
Initialize the Layout and SoundPool |
|
|
397 | (5) |
|
Example #3 Using the Camera API from a LiveCard |
|
|
402 | (5) |
|
|
402 | (2) |
|
Creating a Menu for the LiveCard |
|
|
404 | (2) |
|
Implement CameraLiveCardService |
|
|
406 | (1) |
|
Example #4 Recording a Time-lapse Video |
|
|
407 | (8) |
|
Implementing TimelapseActivity |
|
|
408 | (2) |
|
|
410 | (2) |
|
|
412 | (3) |
|
|
415 | (2) |
|
Part V Android Wear and Glass |
|
|
417 | (60) |
|
Chapter 12 Location and Orientation |
|
|
419 | (58) |
|
Modeling the Earth as an Ellipsoid |
|
|
419 | (1) |
|
Geodetic Latitude and Longitude |
|
|
420 | (3) |
|
|
423 | (1) |
|
|
423 | (1) |
|
Obtaining Location Updates on Android Wear |
|
|
424 | (8) |
|
Register for Node and Location Updates |
|
|
427 | (2) |
|
Using FusedLocationProvider |
|
|
429 | (1) |
|
Requesting and Removing Location Updates |
|
|
430 | (2) |
|
Obtaining Location Updates on Glass |
|
|
432 | (5) |
|
Request and Remove Location Updates |
|
|
435 | (2) |
|
|
437 | (6) |
|
|
438 | (2) |
|
|
440 | (2) |
|
Rotation Matrices and Quaternions |
|
|
442 | (1) |
|
|
443 | (1) |
|
The Rotation Vector Sensor |
|
|
444 | (1) |
|
Rotation Vector in Android Wear |
|
|
444 | (1) |
|
|
445 | (1) |
|
Implementing Rotation Vector in Android Wear |
|
|
445 | (5) |
|
Using Rotation Vector on Glass |
|
|
450 | (5) |
|
|
455 | (1) |
|
True North vs. Magnetic North |
|
|
456 | (1) |
|
|
456 | (1) |
|
Building a Compass in Android Wear |
|
|
456 | (3) |
|
Create a View That Draws a Compass |
|
|
457 | (2) |
|
Implementing CompassActivity |
|
|
459 | (6) |
|
Update the Azimuth and Display Warnings |
|
|
462 | (2) |
|
Obtaining the Declination |
|
|
464 | (1) |
|
Building a Compass in Glass |
|
|
465 | (7) |
|
|
466 | (5) |
|
|
471 | (1) |
|
Using Step Counter in Android Wear |
|
|
472 | (3) |
|
|
475 | (2) |
Index |
|
477 | |