Preferences DataStore Tutorial (Android Jetpack DataStore)

preview_player
Показать описание
In this video I'll be showing you how you can use the new DateStore (Preferences) to store data similiarly to the way you would with SharedPreferences.
​​​​
Рекомендации по теме
Комментарии
Автор

I really appreciate straightforward tutorials like this. Thanks!! looking forward to watching more of your content.

murielgonzalez
Автор

Helped me so much! I was stuck because resources online was so confusing!

darryltang
Автор

The is now nd the createDataStore, preferencesKey and edit no longer work. it asks to rename reference. I'm not finding how to work with the new alpha08, any ideas?

darrinreed
Автор

What an awesome tutorial! I have learned a lot from you, master! Keep it up!

CodeWithMazn
Автор

thanks i had fun learning something new😀

rekettorres
Автор

Perfect explanation and clean code - 5/5

aspixk
Автор

Thanks a lot man! As always very clear and constructed tutorial. Can you also create a video about using dataStore in Java for login session (storing user acount details)?

lucianrekkless
Автор

is there a way to preserve the toggle switch state? it always goes back to the original non-toggled state when app opens again

maryannadelman
Автор

Today you said good morning to me. Now I tell you good evening :-)

MCStarYT
Автор

Great. But how about returning and observing one custom object instead ovserving three live data? Can we do that?

fahidsarker
Автор

I wish the toggle switch state would persist.

maryannadelman
Автор

What if you have a lot of preferences to change? I think it is cumbersome writing save and load function for each preference. Is there a way to write just one save and load function that takes deals with all preferences?

muhammadsarimmehdi
Автор

Is it possible to use DataStore for setting Preference screen? I mean PreferenceActivity.

freecodeland
Автор

What about using the data store un múltiple screens ? How can i use the created one in things like viewmodel, livedata por flows? That lib broke the first thing of shared preferences :/

marlonlom
Автор

great tutorial thx! is there any way to still use the PreferenceFragmentCompat with the new DataStore? Otherwise i have to rebuild my whole settings screen. Would be great if you let me know.

middleaged-downhiller
Автор

How did you change android studio progress look

Автор

What about Encryption? Does it support encrypting of your DataStore?

zakayothuku
Автор

your work on datastore is useful, do not recommend GlobalScope.launch, best practice to use viewModelScope.launch, otherwise ok

juliegray
Автор

// Compile options
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget =
}



// Preferences DataStore
implementation

// Proto DataStore // Not used in this tutorial
implementation

// Lifecycle components
implementation
implementation
implementation
implementation

// Kotlin coroutines components
implementation
api
api

sergiomejiavitoria
Автор

It's all fun and game until you realize the gender is not a boolean anymore...

kienvu