June 2014 - Android wear
-
Upload
blrdroid -
Category
Technology
-
view
106 -
download
0
description
Transcript of June 2014 - Android wear
![Page 1: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/1.jpg)
INTRODUCTION TO �
ANDROID WEAR
Amrit Sanjeev Google Developer Expert
![Page 2: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/2.jpg)
Agenda
• About me • Blrdroid GDG • Android Wear introduction • Q&A
![Page 3: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/3.jpg)
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
![Page 4: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/4.jpg)
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
![Page 5: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/5.jpg)
Android wear�The next level of integration
![Page 6: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/6.jpg)
![Page 7: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/7.jpg)
![Page 8: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/8.jpg)
![Page 9: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/9.jpg)
Coming soon
![Page 10: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/10.jpg)
Interacting for Android wear�Roll up your sleeves
![Page 11: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/11.jpg)
Talk to the wearable
Take actions
the wearable talks to you
actions actions
context
![Page 12: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/12.jpg)
Notifications
![Page 13: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/13.jpg)
NO WORK REQUIRED
![Page 14: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/14.jpg)
Notifications
Stacks Pages Replies
![Page 15: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/15.jpg)
Setting up your developer environment�Roll up your sleeves
![Page 16: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/16.jpg)
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
![Page 17: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/17.jpg)
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
![Page 18: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/18.jpg)
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)
![Page 19: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/19.jpg)
��
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
![Page 20: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/20.jpg)
Things to take care of �think before acting
![Page 21: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/21.jpg)
Keep in mind
Read the design guidelines
Be context aware
Show relevant actions
Think before you notify
Wearable special functionality
![Page 22: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/22.jpg)
Some code snippets �
![Page 23: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/23.jpg)
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();
![Page 24: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/24.jpg)
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);
![Page 25: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/25.jpg)
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();
![Page 26: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/26.jpg)
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);
![Page 27: June 2014 - Android wear](https://reader034.fdocuments.net/reader034/viewer/2022051412/54c76ee24a7959b6248b4593/html5/thumbnails/27.jpg)
�