Save Settings in Shared Preferences Android Studio Tutorial

Publicado el: 22 mayo 2021
en el canal de: Code With Cal
18,325
307

How to save user settings in shared preferences using android studio and java. Example persistent settings page android app development.

In this beginner friendly tutorial, we create a simple settings page with a switch that allows the user to select from a dark theme and a light theme. We then store that information as a string in shared preferences, on the apps close and re open we retrieve the setting and update the activity view accordingly.

In this tutorial we store theme as a string but the basic principles of storing an retrieving values from shared preferences could be used for any variable of any type i.e boolean, float double etc..

Shared Preferences Source Code:
https://github.com/codeWithCal/Shared...

⏱️ TIMESTAMPS ⏱️
00:00 - Intro
00:32 - XML Layout
01:42 - User Settings Java
02:34 - Android Manifest
02:41 - Main Activity

#SharedPreferences #AndroidStudio #AppDevelopment


En esta página del sitio puede ver el video en línea Save Settings in Shared Preferences Android Studio Tutorial de Duración hora minuto segunda en buena calidad , que subió el usuario Code With Cal 22 mayo 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 18,325 veces y le gustó 307 a los espectadores. Disfruta viendo!