Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Wear Projects

You're reading from  Android Wear Projects

Product type Book
Published in Jul 2017
Publisher Packt
ISBN-13 9781787123229
Pages 416 pages
Edition 1st Edition
Languages
Author (1):
Ashok Kumar S Ashok Kumar S
Profile icon Ashok Kumar S

Table of Contents (18) Chapters

Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
Getting You Ready to Fly - Setting Up Your Development Environment Let us Help Capture What is on Your Mind - WearRecyclerView and More Let us Help Capture What is on Your Mind - Saving Data and Customizing the UI Measure Your Wellness - Sensors Measuring Your Wellness and Syncing Collected Sensor Data Ways to Get Around Anywhere - WearMap and the GoogleAPIclient Ways to Get Around Anywhere - UI controls and More Let us Chat in a Smart Way - Messaging API and More Let us Chat in a Smart Way - Notifications and More Just a Face for Your Time - WatchFace and Services More About Wear 2.0

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...
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 £13.99/month. Cancel anytime}