Just FYI, you may need to pin a comment declaring that: The Context.createDataStore extension function has been removed and replaced with globalDataStore property delegate. Call globalDataStore once at the top level in your kotlin file. (official documentations)
@bjugdbjk3 жыл бұрын
Thanks a lot for coding in architecture style and showing the right way of implementing the pref datasore, tysm for sharing the knowledge.
@StevdzaSan3 жыл бұрын
Glad to help!
@vishwaraghavendra83324 жыл бұрын
Great Tutorial! But i feel it's too much of code, unless your app is heavily dependent on SharedPreferences value.. The old way was simple and more compact
@StevdzaSan4 жыл бұрын
Nah its not hard, it's even simpler with separation, you just create repository class and from there manage all your datastore. You can even make a live template out of it.
@شاشةالمسلمالصغير3 жыл бұрын
Thank you. If we have more than one data to store, should we create a save fun and a read fun for each data?
@nataliavalero3340 Жыл бұрын
Awesome tutorial using clean code, exactly what I needed, thanks a lot :)
@patricioconti48522 жыл бұрын
Stevdza-San great Tutorial! But now I would like to know how to use DataStore with PreferenceFragmet that formely used SharedPreferences. Is it possible? Thank you
@jayantkumar19544 жыл бұрын
Awesome tutorial...everything has cleared.. Thank you very much ❤️😀
@jam4l2 жыл бұрын
Another great tutorial, simple and concise, Thank you.
@StevdzaSan2 жыл бұрын
Anytime 👌
@JamieKeefer4 жыл бұрын
Thank you for the quick tutorial. That was an eye opener.
@hdkloh68574 жыл бұрын
What is drawback of existing shared preferences over this...? Also there is another androidx library for security can you make video on that also & compare what to use & when... Nice video as always...👍
@StevdzaSan4 жыл бұрын
Old SharedPreferences is running on UI thread sadly. I will cover security library, but not right now.
@xpopcornx17474 жыл бұрын
@@StevdzaSan It doesn't take many milliseconds to store data in shared preferences tho, it's just saving primitive values.
@nicolasgonzalez29864 жыл бұрын
So for the data store is necessary to use Flow to set the connection through the live data and after the live data to the view? or we can avoid the flow implementation? just asking!
@lucianrekkless4183 жыл бұрын
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)?
@jitenrathore91364 жыл бұрын
Awesome vedio sir keep calm and upload more vedios you are genius man
@bhavyavarmora40494 жыл бұрын
hii Nice tutorial I have doubt that I am getting cityName through response and i have to save that cityName so i don't want to make the call again and again for current cityName So How to store that cityName and for that what code we have to write in fragment i have written code till viewModel for dataStore. For this what code should be written in fragment??
@kirakorunov54072 жыл бұрын
Thanks bro!!!
@fahidsarker48583 жыл бұрын
Can we use it with preference screen layouts?
@vris19674 жыл бұрын
Hey Stefan! We are working on Android Application but we can't use Firebase Realtime Database fine. Can you make videos for us?
@ravisahu3301 Жыл бұрын
can you please make a video on encrypted pref datastore
@thuongpham6605 Жыл бұрын
how to restart textfield still get value data saved???
@m.gentaarya11232 жыл бұрын
How to implements to fragment ?
@IvvyUPlay4 жыл бұрын
I'm implementing it into a fragment class and if i donot restart the app the data doesnot store, how can I fix this?
@alij3fer4 жыл бұрын
Nice job sir ❤
@Rafael-hk9pg3 жыл бұрын
Why LiveData and why Flow?
@entrealist3 жыл бұрын
Okay, Okay, I will work
@kornraweephirawetsakun63564 жыл бұрын
If my login register by create with mysql php and it check to db and i want to add admin and fix user pssword can i get it
@karan241893 жыл бұрын
My app is persisting the data even after uninstalling and reinstalling the app
@karan241893 жыл бұрын
silly mistake from my end allowBackup was true in android manifest. leaving the comment here might help someone
@mauriciopriego17003 жыл бұрын
thank you
@MtaufiqH7314 жыл бұрын
Please explain about coroutine flow spesifictly sir.
@ahmedhegazy84523 жыл бұрын
Thanks
@krishnamandava99194 жыл бұрын
what is the need and use of lificycle dependencies in this project?
@adeelwajid97794 жыл бұрын
because we are working with observers and Coroutines
@JamieKeefer4 жыл бұрын
ViewModel and LiveData are lifecycle aware means to store and use data.
@rizkiadisaputra59714 жыл бұрын
is store credential in shared prefer are secure?
@StevdzaSan4 жыл бұрын
Android 9 (API level 28) started to restrict which apps could make the files in their data directories on internal storage world-accessible to other apps. Apps that target Android 9 or higher cannot make the files in their data directories world-accessible. Android 11 expands upon this restriction. If your app targets Android 11, it cannot access the files in any other app's data directory, even if the other app targets Android 8.1 (API level 27) or lower and has made the files in its data directory world-readable. Read more: developer.android.com/about/versions/11/privacy/storage
@kasems.m48964 жыл бұрын
Also please show what to use instead of Asynchronous Task 😶
@adeelwajid97794 жыл бұрын
@Etelred Etelred it was not Asynchronous task, it was synchronous, if you want to use Asynchronous then you just need to use viewModelScope.launch(Dispatchers.IO) { async{ //write here your code } }
@bloodops38934 жыл бұрын
Yes, but you have more code than if you were using SharedPreferences. So it is, what is is :)
@StevdzaSan4 жыл бұрын
I would say 'cleaner code', plus SharedPreferences is running on main thread while DataStore uses Kotlin coroutines.
@byronlovelace83794 жыл бұрын
Nobody knows how to over engineer a solution better than Google..
@jeremylbt19804 жыл бұрын
In terms of coding simplicity shared preferences is more straight forward. On first look, this data store looks complex and non trivial.