Book Image

Mastering Android Wear Application Development

By : Siddique Hameed, Javeed Chida
Book Image

Mastering Android Wear Application Development

By: Siddique Hameed, Javeed Chida

Overview of this book

Wearable technology is the future of mobile devices. It looks set to be a breakthrough technology, just like the iPad was before it. With the Apple Watch being widely regarded as a success, all eyes are now on Google to provide a similar device for its users. Keep your skills ahead of the competition and be one of the first to fully understand this powerful new trend. This book will give you a very solid understanding of the philosophy, thought process, development details, and methodologies involved in building well-designed, robust Android Wear applications. We cover the advantages and disadvantages of the wearable computing paradigm and provide a good foundational knowledge for you to build practical, real-world wearable apps. You will learn about the various tools, platforms, libraries, SDKs, and technology needed to build Android Wear apps. By the end of the book, you will be an expert in building Android wearable apps.
Table of Contents (18 chapters)
Mastering Android Wear Application Development
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface

Preface

This book is intended for developers working on mobile, desktop, or web platforms interested in learning how to build apps for wearable devices, also known as wear apps. Furthermore, you may already have apps featured on the Google Play store and are looking to provide Android Wear support for your existing Android apps. If either of these statements is true, then yes, this book is for you.

Our primary goal in this book is to provide you, the reader, with a solid understanding of the philosophy, thought process, development details, and methodologies involved in building well-designed and robust Android Wear applications. We'll cover the advantages and the disadvantages of the wearable computing paradigm, and in doing so, we hope to provide a strong foundation for building wearable apps to meet practical and real-world use cases.

We will explore a wide range of concepts and features, from basic to medium to advanced, with varying degrees of complexity. Code samples accompanying each chapter are intended to give you hands-on knowledge of using the tools, libraries, SDKs, and other relevant technology needed to build Android Wear apps.

As you journey through the chapters of this book, you can expect to achieve the following objectives:

  • Understand wearable computing technology

  • Set up your development environment for building Android Wear apps using Android Studio

  • Begin a mastery of the Android Wear SDK and APIs

  • Understand the commonly used UI patterns and UX principles surrounding Android Wear app development

  • Work with different form factors of wearable devices (round, square)

  • Take advantage of the sensors available on Android Wear devices

  • Develop Android Wear sample apps to try out the concepts you learn

  • Communicate between Android mobile (handheld) and Android Wear apps

  • Learn how to publish Android Wear apps to the Google Play store

What this book covers

Chapter 1, Introduction to Wearable Computing, covers the basics of wearable computing in general and how the technology has evolved. It also includes discussions on mobile computing, ubiquitous computing, and cloud computing.

Chapter 2, Setting up the Development Environment, shifts the focus on getting the readers familiar with setting up a development environment, from IDE installation to a discussion of the SDKs and libraries needed for Android Wear development.

Chapter 3, Developing an Android Wear App, walks the reader through step-by-step instructions for developing an Android Wear application, the Today app, from scratch using Android Studio.

Chapter 4, Developing Watch UIs, extends the Today app using UI components available in the Android Wear SDK and builds custom UI components using custom layouts.

Chapter 5, Synchronizing Data, introduces the idea of the need for a companion handheld app, including the steps to pair a handheld with an Android Wear emulator, thereby expanding your environment for wearable app development. The Today app is further extended to demonstrate these concepts.

Chapter 6, Contextual Notifications, discusses notifications in Android Wear and extends the Today app with an On This Day activity to demonstrate the Android Wear Notifications API.

Chapter 7, Voice Interactions, Sensors, and Tracking, discusses the voice capabilities offered by the Wear API. We define a voice action to launch our app. We introduce device sensors and discuss how they can be used to track data.

Chapter 8, Creating a Custom UI, covers the design principles that are central to the Android Wear UI space and examines a few common Wear UI patterns. We also augment the On This Day activity to display in a user-friendly format.

Chapter 9, Material Design, provides a conceptual understanding of material design and touches upon a few key principles specific to wearable app design and development. We solidify our understanding by extending our Todo app from the previous chapters to incorporate a navigation drawer that lets us switch between to-do categories, view items, and perform actions specific to each category.

Chapter 10, Watch Faces, introduces the concept of watch faces in this chapter. After a brief survey of the Android Wear APIs available to help us develop watch faces, we develop a simple interactive watch face.

Chapter 11Advanced Features and Concepts, describes the design concerns and API features related to making apps run as if they were always on. We develop an activity to demonstrate the always-on capability provided by the Wear API. We also touch upon debugging wear apps over Bluetooth connections.

Chapter 12Publishing Apps to Google Play, discusses the tooling available to test Android Wear apps and how to automate UI testing. We conclude the chapter with step-by-step instructions to get the app ready for publishing.

What you need for this book

You will require the following set of tools to try out the codes in the book and to practice the application development yourself:

  • Android Studio v2 or greater

  • JDK v7 or greater

  • Git version control

  • A development system with decent hardware configurations, such as a fast CPU and adequate RAM for developing mobile applications

Who this book is for

Java application developers—web, desktop, or mobile who wants to gain exposure to the Android Wear platform and equip themselves with the knowledge necessary to master the development of Android Wear apps.

Conventions

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

Code words in text, database table names, folder names, filenames, file extensions, path names, dummy URLs, user input and Twitter handles 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 static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
}

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

vi run json

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Clicking the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important to us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Mastering-Android-Wear-Application-Development. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/MasteringAndroidWearApplicationDevelopment_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.