SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
from zero to hero
About me
Android Developer
Tech enthusiast
Writer
RxJava addict
Kotlin curious
What’s new in Android Wear
• API 23
• Emulator
• Permission model
• AudioTrack, MediaPlayer and
ExoPlayer
• -round and -notround resource qualifiers
• Intel x86 support
The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
Setting up the environment
Install the Android Wear SDK from the SDK Manager
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
The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
Download the base project
https://goo.gl/IAGVSJ
The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
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
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
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
The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
Custom stuff
• Custom notifications
• Custom layouts
• Keeping your app visible
Custom stuff
Custom notifications
• Created on Wear
• Not synchronised on the paired device
Custom stuff
• Custom notifications
• Custom layouts
• Keeping your app visible
Custom stuff
Custom layouts
• BoxInsetLayout
• CardFragment
• CircledImageView
• ConfirmationActivity
• CrossfadeActivity
• DelayedConfirmationView
• DismissOverlayView
• GridViewPager
• GridPagerAdapter
• FragmentGridPagerAdapter
• DotSpaceIndicator
• WatchViewStub
• WearableListView
http://goo.gl/JYGOkO
Custom stuff
• Custom notifications
• Custom layouts
• Keeping your app visible
• Extend WearableActivity
• Call setAmbientEnabled()
• Override onEnterAmbient(Bundle ambientDetails)
• Override onExitAmbient()
• Don’t forget onUpdateAmbient()
Custom stuff
Keeping your app visible
http://goo.gl/D7oixw
Custom stuff
• Custom notifications
• Custom layouts
• Keeping your app visible
Custom stuff
goo.gl/D7oixwgoo.gl/JYGOkO
Code time!
~45 minutes
The Wear Playlist
• Setting up the environment
• Download the base project
• Working with Notifications
• Custom stuff
• Sync all the data!
Sync all the data!
• Access the data layer
• Choose the right way to communicate
• Implement the listener
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
Sync all the data!
• Access the data layer
• Choose the right way to communicate
• Implement the listener
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
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
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
Thanks
@_tiwiz

Más contenido relacionado

Similar a Android Wear from zero to hero

Cardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesCardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesMark Billinghurst
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting StartedHemant Chhapoliya
 
Installation and your first code
Installation and your first codeInstallation and your first code
Installation and your first codeGideros Mobile
 
Developing AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityDeveloping AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityMark Billinghurst
 
Cocoapods in action
Cocoapods in actionCocoapods in action
Cocoapods in actionHan Qin
 
Tech Day 2015: A Gentle Introduction to GPS and GNATbench
Tech Day 2015: A Gentle Introduction to GPS and GNATbenchTech Day 2015: A Gentle Introduction to GPS and GNATbench
Tech Day 2015: A Gentle Introduction to GPS and GNATbenchAdaCore
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Codemotion
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Codemotion
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldStefano Sanna
 
CNIT 128 6. Analyzing Android Applications (Part 1)
CNIT 128 6. Analyzing Android Applications (Part 1)CNIT 128 6. Analyzing Android Applications (Part 1)
CNIT 128 6. Analyzing Android Applications (Part 1)Sam Bowne
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!Édipo Souza
 
Devoxx france 2015 influxdb
Devoxx france 2015 influxdbDevoxx france 2015 influxdb
Devoxx france 2015 influxdbNicolas Muller
 
Devoxx france 2015 influx db
Devoxx france 2015 influx dbDevoxx france 2015 influx db
Devoxx france 2015 influx dbNicolas Muller
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDXJussi Pohjolainen
 

Similar a Android Wear from zero to hero (20)

Cardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR ExperiencesCardboard VR: Building Low Cost VR Experiences
Cardboard VR: Building Low Cost VR Experiences
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
Android OS & SDK - Getting Started
Android OS & SDK - Getting StartedAndroid OS & SDK - Getting Started
Android OS & SDK - Getting Started
 
Installation and your first code
Installation and your first codeInstallation and your first code
Installation and your first code
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Android Presentation
Android PresentationAndroid Presentation
Android Presentation
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Developing AR and VR Experiences with Unity
Developing AR and VR Experiences with UnityDeveloping AR and VR Experiences with Unity
Developing AR and VR Experiences with Unity
 
Cocoapods in action
Cocoapods in actionCocoapods in action
Cocoapods in action
 
Tech Day 2015: A Gentle Introduction to GPS and GNATbench
Tech Day 2015: A Gentle Introduction to GPS and GNATbenchTech Day 2015: A Gentle Introduction to GPS and GNATbench
Tech Day 2015: A Gentle Introduction to GPS and GNATbench
 
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
Android Things, from mobile apps to physical world - Stefano Sanna - Giovanni...
 
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
Android Things, from mobile apps to physical world by Giovanni Di Gialluca an...
 
Android Things, from mobile apps to physical world
Android Things, from mobile apps to physical worldAndroid Things, from mobile apps to physical world
Android Things, from mobile apps to physical world
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
CNIT 128 6. Analyzing Android Applications (Part 1)
CNIT 128 6. Analyzing Android Applications (Part 1)CNIT 128 6. Analyzing Android Applications (Part 1)
CNIT 128 6. Analyzing Android Applications (Part 1)
 
Android
AndroidAndroid
Android
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Devoxx france 2015 influxdb
Devoxx france 2015 influxdbDevoxx france 2015 influxdb
Devoxx france 2015 influxdb
 
Devoxx france 2015 influx db
Devoxx france 2015 influx dbDevoxx france 2015 influx db
Devoxx france 2015 influx db
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
 

Último

Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 

Último (7)

Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 

Android Wear from zero to hero

  • 2. About me Android Developer Tech enthusiast Writer RxJava addict Kotlin curious
  • 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!
  • 8. Download the base project https://goo.gl/IAGVSJ
  • 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!
  • 14. Custom stuff • Custom notifications • Custom layouts • Keeping your app visible
  • 15. Custom stuff Custom notifications • Created on Wear • Not synchronised on the paired device
  • 16. Custom stuff • Custom notifications • Custom layouts • Keeping your app visible
  • 17. Custom stuff Custom layouts • BoxInsetLayout • CardFragment • CircledImageView • ConfirmationActivity • CrossfadeActivity • DelayedConfirmationView • DismissOverlayView • GridViewPager • GridPagerAdapter • FragmentGridPagerAdapter • DotSpaceIndicator • WatchViewStub • WearableListView http://goo.gl/JYGOkO
  • 18. Custom stuff • Custom notifications • Custom layouts • Keeping your app visible
  • 19. • Extend WearableActivity • Call setAmbientEnabled() • Override onEnterAmbient(Bundle ambientDetails) • Override onExitAmbient() • Don’t forget onUpdateAmbient() Custom stuff Keeping your app visible http://goo.gl/D7oixw
  • 20. Custom stuff • Custom notifications • Custom layouts • Keeping your app visible
  • 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