These are the slides for the WTT 2015 workshop I gave. See GitHub (https://github.com/tiwiz/Android-Wear-Workshop-WTT) for base and solution of the app
3. What’s new in Android Wear
• API 23
• Emulator
• Permission model
• AudioTrack, MediaPlayer and
ExoPlayer
• -round and -notround resource qualifiers
• Intel x86 support
4. The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
5. Setting up the environment
Install the Android Wear SDK from the SDK Manager
6. Setting up the environment
• Start the Wear emulator
• Enable ADB debug
• Connect your phone to the USB
• Run the adb -d forward tcp:5601
tcp:5601 command
• Pair with the Wear Emulator
7. The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
9. The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
10. Working with Notifications
Big Views
BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
bigStyle.bigText(eventDescription);
new NotificationCompat.Builder(this)
NotificationCompat.Builder notificationBuilder =
.setStyle(bigStyle);
http://goo.gl/GLhd78
11. Working with Notifications
Wear specific actions
BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
bigStyle.bigText(eventDescription);
new NotificationCompat.Builder(this)
NotificationCompat.Builder notificationBuilder =
.setStyle(bigStyle);
http://goo.gl/GLhd78
.extend(new WearableExtender().addAction(action))
// Big Views
12. Working with Notifications
~ 30 minutes
BigTextStyle bigStyle = new NotificationCompat.BigTextStyle();
bigStyle.bigText(eventDescription);
new NotificationCompat.Builder(this)
NotificationCompat.Builder notificationBuilder =
.setStyle(bigStyle);
http://goo.gl/GLhd78
.extend(new WearableExtender()
.addAction(action))
// Big Views
// Wear specific actions
13. The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
22. The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
23. Sync all the data!
• Access the data layer
• Choose the right way to communicate
• Implement the listener
24. Sync all the data!
• Declare Google API Client on both the phone and the wearable project
• Invoke connect() method
• Start using the client in the onConnected() callback
• Module /communication in the sample project
Access the data layer
25. Sync all the data!
• Access the data layer
• Choose the right way to communicate
• Implement the listener
26. Sync all the data!
• DataItem - automatic sync
• MessageApi - remote procedure calls
• Asset - blobs of data
• WearableListenerService -
background services
• DataListener and MessageListener -
foreground components
• ChannelApi - Assets sync’ed with
DataItems, good for large files
Choose the right way to communicate
http://goo.gl/x8t3YG
27. Sync all the data!
• DataItem - automatic sync
• MessageApi - remote procedure calls
• Asset - blobs of data
• WearableListenerService -
background services
• DataListener and MessageListener -
foreground components
• ChannelApi - Assets sync’ed with
DataItems, good for large files
Choose the right way to communicate
http://goo.gl/x8t3YG
28. Sync all the data!
MessageApi and MessageListener
• Find connected nodes with
NodeApi.getConnectedNodes()
• Implement MessageListener
• Set the listener with
MessageApi.addListener()
• Send message with
MessageApi.sendMessage()
http://goo.gl/B5rCMZ
~45 minutes