Using Preferences

SharedPreferences are an easy way to store bits of information that need to persist over the life cycle of an app. In the MyContactList app, preferences are set in the ContactSettingsActivity. This activity is developed so that you can learn how to use SharedPreferences. To do so, the layout is first coded and then the Java file is edited.

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.