© Ted Hagos 2018
Ted HagosLearn Android Studio 3 with Kotlinhttps://doi.org/10.1007/978-1-4842-3907-0_17

17. SharedPreferences

Ted Hagos1 
(1)
Manila, National Capital Region, Philippines
 
What we’ll cover:
  • Introduction to SharedPreferences

  • How to put and get data from a preferences file

  • How to share a preferences file between Activities

Android apps do not persist your data by default. It’s your responsibility to make the data durable and resilient throughout the app’s life cycle. Let’s say you’re collecting data from the user, then midway into your workflow, the application gets interrupted by another app. There is no guarantee that whatever data the user has already input will be there when your app comes back.

Making data durable means storing data ...

Get Learn Android Studio 3 with Kotlin: Efficient Android App Development 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.