Android Wear in-depth analysis: making Android Wear development easier

Android Wear in-depth analysis: making Android Wear development easier

[[121165]]

Introduction

In March this year, Google officially introduced Android Wear as a new member of its Android family to the entire wearable technology field. This new version of the Android operating system is specially designed for wearable devices. Just a few months after this year's Google I/O conference, Google has announced two devices that can run the Android Wear system, namely Samsung Gear Live and LG G Watch.

It's still early days for this new version of the Android operating system, but with more and more Android Wear devices coming to market - with Motorola and HTC set to launch their own Android smartwatches later this year - now's the perfect time to take a comprehensive look at this exciting new platform.

This series of tutorials is divided into two parts. After reading it, you will have an in-depth understanding of all aspects of Android Wear, including what Android Wear is, how it works, and how to develop your own wearable device applications.

In the first part of today's article, you will learn the background information and best practices that you need to know before developing an application, while the second part of the article will truly lead you on the journey of application development for this wearable system platform.

1. What exactly is Android Wear?

The Android Wear operating system uses Bluetooth to connect to handheld devices (single or multiple) running Android 4.3 or higher. Once connected, the wearable device will obtain information and updates from the paired smartphone and/or tablet device and conveniently display them on the user's wrist-worn display. These updates include but are not limited to Google Now information cards, Gmail, Google Calendar, and other mobile phone notifications, such as incoming calls and text messages.

But Android Wear is more than just a convenient way to receive notifications from smartphones and tablets. Android Wear can also perform some of the same tasks that you would on a paired smartphone or tablet. For example, you can use your Android Wear device to play, pause, or skip music tracks from your handheld platform.

Another important user experience of Android Wear is voice commands. The voice command mechanism allows people to perform a variety of tasks on wearable devices and their matching handheld devices. When a user wants to execute a voice command, the first thing to do is to say "Okay, Google", and then express the operation command they need.

The user commands that can be completed on Android Wear with voice alone include the following:

Send text messages, instant messages and emails ('Send Jessica Thornsby a text message' and then say what you want to send).

Get answers to some of life's common questions like "Will it rain this afternoon?" and "Where is the nearest bar?"

Get directions (e.g. 'Take me to Tamper Cafe on West Main Street'). Directions are presented as an information card that matches a Google Map on the handheld device with an information card on the wearable device. The Android Wear device also vibrates to alert the user when they need to turn.

Set reminders to be triggered at specific times or when Android Wear detects that you are near a specific location (e.g. 'remind me to get rid of the wild rabbits in my yard when I get home').

Use Google Keep to take notes (e.g. 'Note, I need to buy more milk').

Launches certain applications on a matching handheld device (e.g. 'Open Facebook').

While this connection means that our wearable applications can leverage a wealth of information and functionality from a paired handheld device, the downside is that technicians usually need to develop two different versions of their applications, one that runs on the wearable platform and a second that runs on the handheld device.

2. Understand the Android Wear user interface

As a new operating system, Android Wear is very different from the systems we are used to on tablets and smartphones. This difference is mainly reflected in the user interface.

Google has developed a new user interface mechanism for Android Wear. For now, you can divide this new user interface into two main components, namely text flow and prompt cards.

Text Flow

Unlike the way we exit and launch applications on smartphones or tablet devices, the main operating mechanism of wearable applications revolves around a card-based system.

The core mechanism of Android Wear's user interface is a vertical stream of reminder cards that automatically prompt corresponding content based on various factors, including current location, current time, and the user's activities and interests. If you are familiar with the design of Google Now, the text stream will also give you a sense of déjà vu - in fact, it is almost equivalent to a set of automatically arranged Google Now information cards.

But unlike the Google Now cards you're used to seeing on your smartphone or tablet, Android Wear can only display one card at a time, and you need to swipe vertically to switch between the available cards.

While it is entirely possible to develop full-screen apps for wearable devices, Google recommends that developers use text flow as the basis for the display effects in their such apps whenever possible.

Our goal should be to create an application that generates information cards and inserts them into the text flow at the right time or under the right conditions to ensure their maximum effectiveness. Users can then browse the relevant text flow and quickly understand the application's prompts and related updates.

Of course, you can also add more information display pages in your notification information card. Users can view these multiple content pages displayed on the notification information card by swiping right.

The screenshot below shows a weather information notification card, which contains today's weather forecast information, and the subsequent pages are used to display the weather conditions in the next few days.

[[121166]]

The image above shows the main notification card on a wearable device.

The image above shows the additional information page on a wearable device.

If the user continues to swipe through additional pages, they may encounter another common element in the Android Wear user interface - the action button. As the name suggests, the action button allows the user to perform a pre-set action, the effect of which can affect the wearable device itself or the matching handheld device.

Cue Cards

Sometimes, users may not be able to get the relevant information they need through notification cards alone, or want to perform a special task. In this case, users can use voice commands to tell Android Wear what they want to achieve.

When the user says "Okay, Google", the voice input command will be activated. At this time, the device actually starts a special "prompt card" mechanism to receive and execute the voice commands given by the user.

[[121165]]

This may sound simple and intuitive, with no room for further exploration, but the emergence of prompt cards actually presents developers with a wide range of room for development.

When the prompt card recognizes and executes a voice command, the underlying operation process is actually that the prompt card successfully matches the voice command with a specific Intent. To make our application respond to voice commands, what we really need to do is to introduce these Intents appropriately.

3. Android Wear libraries and classes

The Android Wear API is delivered through Google Play Services and the Android Support Library. This is a large topic that deserves its own in-depth discussion, but the most important and useful ones to start with are the libraries and classes.

Android Support Library and NotificationCompat

The easiest way to take the first step in wearable application development is to create a handheld device application and ensure that it can send notification information to the matching wearable device.

To extend our notification mechanism in this way, we need to use a variety of classes - you can find them in the Android v4 support library:

NotificationCompat.WearableExtender: This class allows you to add extended functionality for wearable devices to your notification mechanism, and therefore becomes the fundamental premise for us to maximize the experience of using Android Wear applications.

NotificationCompat.Builder: This builder class ensures that our notification content is displayed correctly, including on handheld devices and wearable devices.

NotificationManagerCompat: This class ensures that our notification mechanism correctly supports various features on wearable devices. When the conditions for notification information delivery are met, please make sure that you use NotificationManagerCompat instead of NotificationManager. If you use NotificationManager, some NotificationCompat.WearableExtender features may not work properly.

NotificationCompat.Action.WearableExtender: This class can extend the notification operation mode on wearable devices. Each action needs to have its own title, an icon used to represent the action, and an Intent to which the content is sent when the action is triggered.

To add the Android v4 support library to our development environment, you first need to open the Android SDK Manager, then download and install the corresponding software package: if you are using Eclipse, you need to download and install the Android Support Library package; if you are using Android Studio, you need to download and install the Android Support Repository.

Wearable UI Support Library

This unofficial library can help you design user interfaces for your applications that are suitable for wearable device platforms, including user interface features that meet best practice requirements.

As the most important component of this support library, the BoxInsetLayout layout manager deserves our emphasis. It allows everyone to use the same layout solution directly on square and round wearable devices.

If you are using the Android Studio development environment, this library will be automatically included when you create a wearable application using the project navigator.

4. Best Practices

Before you fire up your development environment and put your ideas into action, it's important to first consider how to create a great Android Wear app - in other words, how can we provide an unparalleled user experience for our app users.

In the second part of this system article, we will discuss the best practices that you should keep in mind and follow when developing Android Wear applications.

Create applications that are easy to view

The key to developing great Android Wear apps is to keep in mind the habits and features we have acquired from using traditional watches. When wearing a traditional watch, do we need to stare at the watch face for a long time to get information? Or do we only need to glance at the situation to ensure that we have all the necessary information at hand?

Users undoubtedly want to get the same interactive experience on their smartwatches, that is, to expand the functionality while maintaining the simple and quick viewing experience of ordinary watches. In view of this, one of the prerequisites for a successful wearable application is to make it as easy to view as possible. To design such easy-to-view applications and notification information cards, you need to keep in mind and follow the following guidelines.

Display one message at a time

Our notification cards should only display one piece of information at a time. If we need to deliver more information, it is better to use additional pages instead of cramming too much content into the card.

Keep text as simple as possible

Our notification information cards should only contain key words and phrases, not complete sentences. Here is a tip to simplify text description, that is, match a single icon with a single value. For example, if you want to express "50% chance of rain today", an easy-to-read design can directly use the cloudy and rainy icons and add the value label "50%".

Increase font size

By increasing the font size, we can ensure that users can easily understand the content displayed on the wearable device at a glance. When you use large fonts as a display method, the total amount of information that can be accommodated in a single information card will also be reduced, so please keep in mind this.

Reasonable use of background images

As the old saying goes, a picture is worth a thousand words. You can make the content in the notification card easier to see and understand by adding a background image.

Different notifications generated by your app can often look better and feel better if you choose a simple and intuitive background image. For example, if you are designing a wearable app that notifies users of current traffic conditions, it would be helpful to add three background images to the information about the roads users travel most often - one for an open and smooth road, one for a road with few cars, and the last for a road with heavy traffic. At run time, when the app generates a new information card, it can choose the most eye-catching background image as a prompt based on the relevant value. Even if the user is busy with other trivial things and cannot view the content on the device in detail, it is still enough to get a very useful general conclusion from the background image.

[[121167]]

Keep interactions simple

Here we have to emphasize again, please take into account the actual habits of users when using ordinary watches. Imagine, are we really willing to sit down and take a few minutes to study the display on the watch? The answer is obviously no, it is not a watch at all, but a spy device.

Since it is called a smart watch, we must ensure that it can allow users to easily grasp real-time information and complete the operations they need while traveling, just like ordinary watches. In other words, through the careful design of wearable applications, smart watches can fully maintain this fine tradition of ordinary watches. Users hope that their wearable applications can provide necessary prompt information, but they are unwilling to operate through complex menu navigation and touch selection.

With this in mind, please make sure that your application only requires user input when it is absolutely necessary. In this extremely special case, we must also ensure that users can complete input and interaction operations as quickly and easily as possible, such as tapping, swiping, and voice commands. Please note that any slightly complex operation method will become a nightmare for users to avoid on the small screen of a wearable device.

If our application really needs to introduce some more complex interaction mechanisms, please do not force users to complete these operations on the wearable platform. Instead, guide them to the matching handheld device, where they can complete the task on the large screen and then return to the wearable device to get the results of the operation.

In the screenshot below, tapping the action button launches the relevant app on the user’s matched smartphone, where they complete the specific interaction necessary to get a response.

[[121168]]

Avoid using active notification mechanisms as much as possible

Wearables, as the name implies, are electronic devices that come in direct contact with the user’s skin. This means that any proactive notifications — those that cause the device to vibrate — will get the user’s attention and are almost impossible to ignore.

From a certain perspective, this is a good thing. For example, when we pair our wearable devices with our smartphones, we no longer have to worry about missing important calls because we put our phones in our bags. However, since these proactive notifications are almost impossible to ignore, a wearable app that frequently sends proactive notifications will quickly make users irritable.

As a general rule that needs to be strictly followed, our wearable application should only deliver active notifications when it receives information related to contacts and current real-time events, such as a text message received by the paired smartphone. In the absence of such conditions, our application should instead generate an information card and insert it into the text stream, ready for the user to view the next time he raises his wrist.

In short, at least make sure that your wearable app uses proactive notifications less frequently than the smartphone or tablet version.

Summarize

In the first part of this tutorial series, you have gained a deep understanding of the features of the Android Wear operating system and how they affect users and developers. In addition, you have learned the best practices to follow when developing excellent wearable applications.

In this second article, I'll show you how to set up your development environment and start developing applications for the Android Wear platform.

English link: http://code.tutsplus.com/articles/introduction-to-android-wear-the-basics--cms-22042

<<:  Baidu 2014 Mobile Distribution Trend Report: The demographic dividend is disappearing

>>:  Telecom Open Platform Releases In-App Billing SDK to Help Apps Make Small Amounts of Quick Payments

Recommend

How much does it cost to customize the Chengde housekeeping mini program?

There is no fixed price for the customization of ...

Tik Tok account homepage design guide

1. Why should we pay attention to the homepage de...

A case study of the WeChat Moments distribution that sold 8,000 copies

Event background: On November 13, 2019, I saw a c...

Who is the baby? The correct way to calculate the dog's age

Dogs are man’s best friends. We often say that on...

Steve Jobs once put an offer in front of me, but I chose Cisco

Jerry Yang became famous too early. He is only 47...

Have you been fooled by wearable devices?

There have always been different opinions about t...

The bitter winter is gone, and the plum blossoms of spring are in season

Produced by: Science Popularization China Author:...

Analysis of social e-commerce marketing crowd trends!

The rise of Pinduoduo, Yunji and others has set o...