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