Preface - Android Wearable Programming (2015)

Android Wearable Programming (2015)

Preface

Android Wear is becoming extremely popular, and offers a great opportunity for developers to learn how to build applications for the Android Wear platform, which is a special version of the core Android OS, and has been tailored for wearable computing devices such as smartwatches. These wearable devices come with a brand new user interface, which is the result of Google working with their customers to understand how they use their phones today and how they can be more in touch with their environment.

Android Wearable Programming provides a practical approach to developing and building Android apps using the Android Studio Integrated Development Environment. The new Android Studio IDE has introduced a specialized development environment that has been welcomed by the emerging Android community. This IDE is perfect to develop Android Wear apps because of the tight integration it has with the Wear development APIs, and also the streamlined build cycle with Gradle that helps to minimize a lot of manual configuration that the developer would need to do in other IDEs.

In this book, I have tried my best to keep the code simple and easy to understand by providing a step-by-step approach, with lots of screenshots at each step to make it easier to follow. You will soon be mastering the different aspects of Android Wear programming, as well as the technology and skills needed to create your own applications for the Android Wear platform.

Feel free to contact me at <support@geniesoftstudios.com> if you have any queries, or if you just want to drop by and say "Hello".

What this book covers

Chapter 1, Understanding Android Wearables and Building Your First Android Wear App, describes the background of the Android Wear platform architecture and shows you how to set up and configure the Android development environment, before finally looking at how to create a simple Android Wear app.

Chapter 2, Creating Notifications, introduces you to Android notifications, where you will learn how to create basic and custom notification messages. You will learn how to incorporate voice capabilities to read out the content of the notification, before learning how to group multiple notification messages using page-stacking.

Chapter 3, Creating, Debugging, and Packaging Wearable Apps, focuses on designing and creating custom watch faces to present information within the Android wearable watch area. You will learn how to effectively debug your app over Bluetooth, before finally learning how to package your wearable app so that it can be used within the handheld mobile device.

Chapter 4, Sending and Syncing Data, introduces you to the Data Layer API and the Message API frameworks, so that you can synchronize image data from the handheld device with the wearable, as well as use the Message API to communicate between the handheld and the wearable to send and receive messages.

Chapter 5, Working with Google Glass, explores how to build effective user interfaces for the Google Glass platform by creating user interfaces that display content that responds to voice input commands, before finally learning how we can access the Glass camera to take a snapshot and save the image to local storage.

Chapter 6, Designing and Customizing Interfaces for Android TV, provides you with the background and understanding of how to effectively present your app within the main user interface and how you can design your app by following the Android TV UI Patterns to help users get the content they want quickly. Also, you will learn how to create and use fragments that allow information to be presented within the Android TV interface to represent your content.

What you need for this book

For this book, you need a computer running a Windows, Mac OS, or Linux system. You will also need to have the Android Studio IDE and both Java and Java Runtime Environment installed on your system.

Who this book is for

This book is intended for developers who have a working experience of the application development principles for the Android platform and wish to expand their Android capabilities by developing applications for Android wearables using the key features of Android Studio. It's assumed that you are familiar with object-oriented programming and the Java programming language.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

public class MainActivity extends ActionBarActivity {

// Set up our Notification message ID

int NOTIFICATION_ID = 001;

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:21.0.3'

compile 'com.android.support:support-v4:20.0.+'

}

Any command-line input or output is written as follows:

$ ./adb forward tcp:4444 localabstract:/adb-hub

$ ./adb connect localhost:4444

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Next, click on the Install packages button as shown in the preceding screenshot."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.