34Local Databases with SQLite

Applications with large or complex data sets often need more power than you can get from simple file formats like JSON. In RunTracker, the user can continue tracking his or her location forever, which can generate a lot of data. The logical choice for such data sets in Android is a SQLite database. SQLite is an open source, multi-platform library that gives you access to a powerful, relational database API backed by a single file on disk.

Android includes a Java front-end to SQLite through the SQLiteDatabase class, which provides result sets as Cursor instances. In this chapter you will create a storage mechanism for RunTracker that uses a database to store data about runs and their locations. You will also create ...

Get Android Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.