O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required