Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

June 2014 - Android wear

1,415 views

Published on

Amrit Sanjeev talks about Android Wear, what it is, why is it useful, and how you can get your apps use things related to Android Wear

Published in: Technology

June 2014 - Android wear

  1. 1. INTRODUCTION TO ANDROID WEAR Amrit Sanjeev Google Developer Expert
  2. 2. Agenda •  About me •  Blrdroid GDG •  Android Wear introduction •  Q&A
  3. 3. About me •  Organizer, Bangalore Android User Group ( www.blrdroid.org ) •  Google Developer Expert (GDE) for Android. •  Part of Intel Android Influencer program. •  Staff engineer for Mobile at Digital Insight (formerly Intuit). •  Previous companies – Philips research, IBM. •  Mentor at 10,000 startups
  4. 4. Bangalore Android User Group ( www.BlrDroid.org) •  Largest open Android developer community in the India •  Over 5100+ members •  4.5+ years and completely free. •  54 meet-ups •  5 hackathons •  Blrdroid teach – College edition more than 2300+ students from over 35 colleges participated. •  Active participation in events like Droidcon, Global Android Developer hackathon, Google Bizdroid etc
  5. 5. Android wear The next level of integration
  6. 6. Coming soon
  7. 7. Interacting for Android wear Roll up your sleeves
  8. 8. Talk to the wearable Take actions the wearable talks to you actions actions context
  9. 9. Notifications
  10. 10. NO WORK REQUIRED
  11. 11. Notifications Stacks Pages Replies
  12. 12. Setting up your developer environment Roll up your sleeves
  13. 13. Prerequisites ●  On computer ●  Install Android Studio / Eclipse bundle ●  Sign up for Android Wear Development Preview ●  Install the preview support library ●  On device ●  Install Android Wear Preview beta app
  14. 14. Install Android Wear System Image ●  Android SDK Tools revision 22.6 or higher ●  Android Wear ARM EABI v7a System Image ●  Update Android Support Library ●  Download the wearable preview support jar
  15. 15. Setup the Android Wear Emulator ●  Launch the Android Virtual Device Manager ●  Target Android 4.4.2 - API Level 19 ●  CPU Android Wear ARM (armeabi-v7a)
  16. 16. Setup Android Wear Preview app ●  Settings: grant notification access ●  Connect your device over USB ●  adb -d forward tcp:5601 tcp:5601 ●  If the icon in the emulator changes to “g” - Good
  17. 17. Things to take care of think before acting
  18. 18. Keep in mind Read the design guidelines Be context aware Show relevant actions Think before you notify Wearable special functionality
  19. 19. Some code snippets
  20. 20. Wearable only functionality // Create a NotificationCompat.Builder for standard notification features NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext) .setContentTitle("New mail from " + sender.toString()) .setContentText(subject) .setSmallIcon(R.drawable.new_mail); // Create a WearablesNotification.Builder to add special functionality for wearables Notification notification = new WearableNotifications.Builder(notificationBuilder) .setHintHideIcon(true) .build();
  21. 21. Adding actions NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_event) .setContentTitle(eventTitle) .setContentText(eventLocation) .setContentIntent(viewPendingIntent) .addAction(R.drawable.ic_map, getString(R.string.map), mapPendingIntent);
  22. 22. Multipage notifications // Create builder for the main notification NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)…… // Create a big text style for the second page BigTextStyle secondPageStyle = new NotificationCompat.BigTextStyle(); secondPageStyle.setBigContentTitle("Page 2") .bigText("A lot of text..."); // Create second page notification Notification secondPageNotification = new NotificationCompat.Builder(this) .setStyle(secondPageStyle) .build(); // Create main notification and add the second page Notification twoPageNotification = new WearableNotifications.Builder(notificationBuilder) .addPage(secondPageNotification) .build();
  23. 23. Stacked notifications Notification notif1 = new WearableNotifications.Builder(builder) .setGroup(GROUP_KEY_EMAILS) .build(); // Issue the notification NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); notificationManager.notify(notificationId1, notif); builder = new NotificationCompat.Builder(mContext) .setContentTitle("New mail from " + sender2) .setContentText(subject2) .setSmallIcon(R.drawable.new_mail); // Use the same group as the previous notification Notification notif2 = new WearableNotifications.Builder(builder) .setGroup(GROUP_KEY_EMAILS) .build(); notificationManager.notify(notificationId2, notif);

×