Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android Wearable Programming

You're reading from   Android Wearable Programming Expand on your Android development capabilities by building applications for Android Wear

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781785280153
Length 224 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Steven F. Daniel Steven F. Daniel
Author Profile Icon Steven F. Daniel
Steven F. Daniel
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. Understanding Android Wearables and Building Your First Android Wear App 2. Creating Notifications FREE CHAPTER 3. Creating, Debugging, and Packaging Wearable Apps 4. Sending and Syncing Data 5. Working with Google Glass 6. Designing and Customizing Interfaces for Android TV Index

Creating a custom watch face service class

In this section, we will proceed to create our custom watch face service class that will be used to invoke the methods within the watch face service API. This class will be responsible for allocating and initializing the resources that our watch face requires. Watch faces are services and shouldn't be confused with activities, as these types of services only accept touch input and voice commands as a form of interaction.

First, we need to create a new class called WatchFaceService:

  1. From the Project Navigator window, expand the wear section and select and expand the java section.
  2. Next, right-click and choose the New | Java Class menu option:
    Creating a custom watch face service class
  3. Then, enter WatchFaceService to be used as the name for our class and click on the OK button:
    Creating a custom watch face service class
  4. Upon clicking the OK button, the Android Studio code editor will open, as shown in the following screenshot:
    Creating a custom watch face service class

    Our next step is to write the code that will communicate with our Android wearable device. For this, we will...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image