© 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.