Skip to Main Content
Programming Android, 2nd Edition
book

Programming Android, 2nd Edition

by Zigurd Mednieks, Laird Dornin, G. Blake Meike, Masumi Nakamura
September 2012
Intermediate to advanced content levelIntermediate to advanced
566 pages
16h 52m
English
O'Reilly Media, Inc.
Content preview from Programming Android, 2nd Edition

Chapter 9. Handling and Persisting Data

To accomplish many of the activities offered by modern mobile phones, such as tracking contacts, events, and tasks, a mobile operating system and its applications must be adept at storing and keeping track of large quantities of data. This data is usually structured in rows and columns, similar to a spreadsheet or a very simple database. Beyond a traditional application’s requirements for storing data, the Android application life cycle demands rapid and consistent persistence of data for it to survive the volatility of the mobile environment, where devices can suddenly lose power or the Android operating system can arbitrarily decide to remove your application from memory.

Android provides the lightweight but powerful SQLite relational database engine for persisting data. Furthermore, as described in Chapter 3, the content provider feature lets applications expose their data to other applications.

In this chapter, we provide a simple SQL tutorial so that you can learn to work with Android SQLite persistence. We also walk you through an interesting application—MJAndroid—that provides a real-world look at how to manipulate a database in Android. Later, in Chapter 15, we’ll reference the same example to demonstrate the use of the mapping API in Android. Chapter 12 will show you how to implement a content provider.

Relational Database Overview

A relational database provides an efficient, structured, and generic system for managing persistent information. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Android, 2nd Edition

Learning Android, 2nd Edition

Marko Gargenta, Masumi Nakamura
Learning Embedded Android N Programming

Learning Embedded Android N Programming

Ivan Morgillo, Stefano Viola

Publisher Resources

ISBN: 9781449332921Errata PageSupplemental Content