O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required