Chapter 7. Storing data locally

In this chapter

  • Reading and writing files
  • Setting and remembering shared preferences
  • Working with SQLite databases

Data is a precious thing and will last longer than the systems themselves.

Tim Berners-Lee

Data is essential to any application, and Android provides several local storage avenues. But Android doesn’t stop there—you also have access to data from other applications on the device and the network, which we’ll learn about in upcoming chapters. First, we’ll focus on local data storage.

To explore local data storage we’ll start with the filesystem. Don’t forget: Android devices are small computers, and they have filesystems. We’ll see how you can check whether the filesystem is available, how you ...

Get Android in Practice 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.