Chapter 12

Getting Persistent with Data Storage

In This Chapter

arrow Discovering data-storage media

arrow Getting user permissions

arrow Creating an SQLite database

arrow Querying your database

In certain types of applications, Android requires application developers to use data persistence, where information about a user’s preferences, such as favorite background colors or radio stations, is saved on the device for reuse later, after the device is turned off and then on again. For example, the Task Reminder application wouldn’t be useful if it didn’t save tasks, would it? Thankfully, the Android platform (in combination with Java) provides a robust set of tools that you can use to store user data.

This chapter delves deeply into creating and updating an SQLite database and producing a ContentProvider to access it. You need to be familiar with a certain level of database theory to tackle the data storage tasks in this chapter.

tip.eps If you’re unfamiliar with SQL (Structured Query Language) or the SQL database, see the SQLite website at www.sqlite.org for more information.

This chapter is code-intensive — if you start feeling lost, you can download the completed application source code from this book’s website.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset