Save Settings in Shared Preferences Android Studio Tutorial

Publicado em: 22 Maio 2021
no 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


Nesta página do site você pode assistir ao vídeo on-line Save Settings in Shared Preferences Android Studio Tutorial duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Code With Cal 22 Maio 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 18,325 vezes e gostou 307 espectadores. Boa visualização!