Chapter 6. Working with Data
In this chapter, we will cover the following topics:
- Storing simple data
- Read and write a text file to internal storage
- Read and write a text file to external storage
- Including resource files in your project
- Creating and using an SQLite database
- Access data in the background using a Loader
Introduction
Since almost any application, big or small, requires saving some kind of data, Android offers many options. From saving a simple value to creating full databases using SQLite, storage options include the following:
- Shared preferences: simple name/value pairs
- Internal storage: data files in private storage
- External storage: data files in private or public storage
- SQLite database: private data can expose the data through a Content ...
Get Android Application Development Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.