Preferences, Files, and Database

The three approaches to data persistence discussed in this chapter are SharedPreferences, standard flat file input/output, and the SQLite database system. Each of these approaches provides capabilities that are relevant for different tasks in an app. SharedPreferences are often used for a limited set of data that represent user choices about the way they want the app configured. They may also be used for other data that needs to persist across life cycle changes. Flat files are useful for backing up data and transmitting to other users. Finally, databases are the workhorses for data manipulation, storage, and retrieval. Developing an understanding of where, when, and how to use these data persistence approaches ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android 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.