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. 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
16. 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
17. 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
18. 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)
19. 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
23. 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();
25. 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();
26. 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);