Book Image

Android Wear Projects

By : Ashok Kumar S
Book Image

Android Wear Projects

By: Ashok Kumar S

Overview of this book

Android Wear Projects is your opportunity to step into the exciting new world of Android Wear app development. This book will help you to master the skills in Android Wear programming and give you a complete insight on wear app development. You will create five different Android Wear apps just like the most popular Android Wear apps. You will create a To-do list, a city maps app, a Wear messenger, Wear fitness tracker and Watch face. While you create these apps you will learn to create custom notifications, receive voice inputs in notifications, add pages to notifications and stack notifications. You will see how to create custom wear app layouts, the custom UIs specially designed for Wear. You will learn to handle and manage data and syncing data with other devices, create interactive Watch faces and also ensure the safety and security of your Wear apps by testing and securing your apps before you deploy them on the app store.
Table of Contents (18 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
2
Let us Help Capture What is on Your Mind - WearRecyclerView and More
3
Let us Help Capture What is on Your Mind - Saving Data and Customizing the UI
5
Measuring Your Wellness and Syncing Collected Sensor Data
9
Let us Chat in a Smart Way - Notifications and More

Configuring SQLite and saving the markers


Persisting all the necessary data is the fundamental use case for any good software. Android SDK provides an SQLite storage solution built in. It has a very small footprint and is very fast. If a is familiar with SQL queries operations, SQLite is going to be easy and delightful to work with.

Schema and contract

Essentially, for a database, we need to create a data schema, which is a formal declaration of how the is organized. The is reflected in the SQLite query statements. A contract class is a for constants that define names for URIs, tables, and columns. The class allows the use of the same constants across all the other classes in the same package.

For the scope of WearMapDiary, we will create all the instances in the DBHelper class. Now, let's create the DBhelper class, which opens and connects the application to SQLite and processes the query:

public class DbHelper extends SQLiteOpenHelper {

    private static final String DATABASE_NAME...