- Android Wearable Programming
- Steven F. Daniel
- 1329字
- 2021-07-16 13:31:42
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.
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 for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <feedback@packtpub.com>
, 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 from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.
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 <copyright@packtpub.com>
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 <questions@packtpub.com>
, and we will do our best to address the problem.