Summary

Data that exists beyond the execution of the app is said to persist. In this chapter you learned several methods to make data persist in your app. You also learned how to get that persistent data for use in the app. A SQLite database is used to store complex data. You created a class (ContactDBHelper) to create and update the database and its contents. You created a class (ContactDataSource) to access the database. Finally, you created a class (Contact) to pass a contact’s data from and to the database methods.

The second method you learned to persist data was through the SharedPreferences object. The SharedPreferences object is used to store primitive bits of data, such as strings and integers. You learned how to put data into a SharedPreferences ...

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.