The market for smart wearable technology is forecast to grow by over 500% in 2015 compared with 2014, with vendors shipping over 25 million units. Bluetooth® Smart is integral to many of these devices, providing users with a seamless, “just works” connected experience. Wearable devices, smartphones and cloud-based Internet services can all work together with no explicit action or special knowledge required on the part of the user. Yes, it really is just like magic! In my series of blog posts on beacons for developers, I discussed smartphone applications which monitor for and react to the presence of Bluetooth® beacons. In part 2 of the series, I described a museum guide application for Android smartphones which used Bluetooth beacons to alert the user to the proximity of key museum exhibits. In this blog series, I now consider how the beacon experience can be made a wearable one and describe how I went about creating a museum guide for your wrist.

Android Wear

In 2014, Google announced Android Wear, a new version of the Android operating system designed for wearable devices. Android Wear allows bidirectional communication between wearable devices and other devices which are running the “full” Android operating system. Typically Android Wear devices like my Moto 360 smartwatch work in conjunction with an Android smartphone.

Architecture and the Role of Bluetooth Smart

In the world of Android Wear, devices are known as nodes, they each have particular capabilities and they’re connected in the Wear Network. Typically a smartphone will form the hub of the Wear Network with other types of nodes such as smartwatches connected to it. Node-to-node communication uses Bluetooth Smart. As an Android Wear developer, you need to know little or nothing about Bluetooth Smart however! The APIs for Android Wear have hidden the underlying Bluetooth® technical details, making it really easy to accomplish some very cool results. That said, Android Wear also allows you to use standard Android Bluetooth Smart APIs such as android.bluetooth.le.BluetoothLeScanner directly from your Android Wear application, so it is possible to interact with other Bluetooth Smart devices from a wearable, without any form of collaboration with a smart phone. Wearable devices are likely to be significantly less powerful than the smartphone hub so it’s more common for wearables and smartphones to work together, with the smartphone doing any heavy lifting which might be required. I’ll focus on these types of scenario in this article.


Figure 1 – Architecture

Three Approaches to the Wearable Museum Guide

I looked at three different ways in which I could extend my Museum Guide smartphone application to a Moto 360 smartwatch:

  1. Use standard Android notifications
  2. Use notifications extended for Android Wear devices
  3. Develop an Android Wear application which runs on the wearable

I’ll describe each of the two notification-based approaches in this article and look at developing an Android Wear application in Part 2.

Standard Notifications

So here’s some really good news. Any notification which an Android smartphone raises will automatically be delivered to each connected wearable. So if you already use notifications in your Android smartphone application, you can consider your application to be wearable-friendly without having written a single, specialised line of code. How cool is that?

Figure 2 – Standard Notification from the GetYourBeacOn Application on a Moto 360

Part 2 of my beacon series includes a snippet of code used to generate notifications.

Extended Notifications for Wearables

The Android APIs provide a means by which you can tailor notifications for wearable devices and do much more than just display notifications generated from your smartphone in an equivalent way on the wearable device. For example you can utilise special text styles, set the background image used in the notification, set up multiple pages that the user can swipe through for notification details and last but not least, you can add “actions” to your notification to make it interactive when viewed on the wearable device. I decided to provide users with multiple pages of information on their Android Wear device and also add some interactivity so that users could indicate whether they liked or disliked a particular exhibit. This was quite easy to accomplish, largely by leveraging a helper class called WearableExtender. Let’s briefly review the code. We begin by creating three pages containing the primary items of information about the exhibit. We use a text style designed for wearable devices to make information easier to read as well.

Figure 3 – Creating Notification Pages

Next we create Action objects corresponding to the interactive Like and Dislike choices we want to offer to the user. Actions are similar to pages but have an associated Intent, wrapped in a PendingIntent object. In Android, an Intent is an operation to be performed and a PendingIntent is an Intent which can be handed to another application for execution. In this case, the other application is the smartphone Museum Guide application and I’m stipulating that the PendingIntent should launch an Activity called NotificationActionHandler.

Figure 4 – Creating Actions to Make the Notification Interactive

Finally, we create a Wearable Extender which contains our additional pages and actions, and build a Notification which includes it, along with data representing generally applicable settings and our first notification page. We trigger the notification and that’s it. The wearable device receives a multi-page, interactive notification.

Figure 5 – Adding Wearable Extensions to the Notification

The resultant notification is depicted below using screen shots taken from my smartwatch.

Figure 6 – Extended, Interactive Notifications on the Wearable Device

When the Like or Dislike action is selected, the NotificationActionHandler Activity launches on the smartphone and displays one of the following screens:

Figure 7 – The Smartphone Application Responding to an Action Selected on the Wearable

As you can see, you can do a lot purely by exploiting Android notifications.

Summary

Getting started with Android Wear is easy. Notifications are already familiar to most Android developers and Bluetooth® Smart takes care of communication between smartphone and wearable device quietly, behind the scenes without the developer needing to have any special knowledge of the subject.

Demonstration

Bluetooth Developer Journey

As a leading player in the semiconductor industry committed to the development of cutting-edge…

Generic Health Sensor Design and Implementation Guide

The Generic Health Sensor (GHS) Design and Implementation Guide guides implementers of health sensor…

Doom running on Silicon Labs & Sparkfun Microcontrollers: A Quick Look

Doom has recently reached its 30th anniversary, yet it remains a masterpiece and a…

Auracast Simple Transmitter Best Practices Guide

This paper provides a set of clear, concise, and useful recommendations for product makers interested in building Auracast transmitter products.

5.7 km of Bluetooth® Range

40 km from Irvine, California gets you to beautiful Newport Beach Pier, and 5.7…

Synthesize and Transmit Audio Using LE Audio

The application is assembled as a sound-generating device, the synthesizer, and a receiving headphone.…

Unveiling the Truth: Debunking Bluetooth’s Biggest Myth

Bluetooth Low Energy was designed to considerably reduce power consumption and cost while maintaining…

Bluetooth® Mesh Feature Enhancements Summary

This paper summarizes the recent Bluetooth® Mesh feature enhancements and provides references to other…

The Latest in HADM with Bluetooth LE

HADM, or high accuracy distance measurement using Bluetooth does exactly what it says –…

Mr. Beacon Podcast: Snapdragon Sound with Mike Canevaro

This episode of the Mr. Beacon Podcast explores the revolutionary world of Bluetooth audio.…

Top 10 Auracast™ Resources

It’s been almost a year since the Bluetooth Special Interest Group (SIG) released Auracast™…

Features and Benefits of Bluetooth Mesh 1.1 for Wireless Mesh Networking

Commercial and industrial applications like lighting require large-scale, low-power device networks where thousands of…

The Bluetooth® Low Energy Primer

Are you new to Bluetooth Low Energy? Learn about its constituent parts, features, and how it works.

Bluetooth® Technology for Linux Developers

Learn how to use the interprocess communication system D-Bus and the BlueZ APIs to create Bluetooth applications for Linux computers.

Designing and Developing Bluetooth® Internet Gateways

Learn about Bluetooth® internet gateways, how to make them secure and scalable, and design and implement your own...

 Get Help