Saving data with Shared Preferences in Android Studio (Kotlin 2020)

preview_player
Показать описание
In this video I'll be showing you how to save very basic (primitive) data using Shared Preferences, and I found it much easier to do in Kotlin, although it's really the same thing.

As always, if you have any questions, or requests for future videos, leave them in the comment section and I'll try to make a video about it!
Рекомендации по теме
Комментарии
Автор

I have watched tutorials for around 15 years now about many many many stuffs, never seen one as good as this one. Precise, quick, prefect... ty

sofianosss
Автор

Quick, straightforward. Best tutorial ever!

nakajimakuro
Автор

I believe this is exactly what I need for my app. Thanks for a short but sweet primer!

actualnatural
Автор

Great! I really like the idea that it's about the technique and you don't spend ages setting up a basic app. Many thanks.

JohnoOz
Автор

I'm convinced you deserve more followers and more likes. I like your videos! Keep going

marekstorek
Автор

You saved my day and saved me a lot of stress. Straight forward and quick to the point without BS jargons. Sir, where is the link wher I can buy you a coffee ;)

m.g.mourad
Автор

Thank you for making it simple and it worked right off the bat.

JulianGonzalez-ejfi
Автор

I love these short tutorials! Thank you very much saved me 10 mins

Olcay
Автор

Another great short tutorial, with important information. Yes, even with a simple string text you can do a lot. I like to write out arrays of data with comma separation to a single string, then load in the string and split that data by finding those commas and re-iterate it to a list. I commonly write in C languages but I think the concept can be applied to kotlin.

MrJasonSnell
Автор

I had a heck of a time finding this AND it is exactly what I needed, perfect ~ thank you. I did have to massage it a bit to work with Kotlin (in Android Studio 4.2.2). I have a question for you. How would a person display their saved string with a % sign or a $ sign, appended automatically? Or any other static text for that matter?

VaughnWarriner
Автор

thx allot, do you maybe have a video on how i can save more complex data types like an ArrayList<CustomClass>

eitansharabi
Автор

I fucking love it man, thank you so much. I needed this

marioagrataboada
Автор

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

lucianrekkless
Автор

Great tutorial. Any idea though how to make it work in a viewmodel? Can't seem to find anything on this anywhere.

strbusta
Автор

Can this be used alongside Firestore? I intend to use Shared Preferences to retain the state of some TextViews, and Firestore to store, and send data between users.

abovebelow
Автор

how would I be able to save a global int value and pass it to the private function?

yagizsen
Автор

Loved it! Thank you!!!

Finally some taste of saving something inside the app. 😅

I'm starting in Kotlin programming and now I'm quite motivated to learn more about how to save data.

Oh, and I'll try your MVVM playlist, so thanks again!

Augusto
Автор

Hey can you do a video to enter data from a second activity and to always show the saved data on the main screen

jeremiemlb
Автор

This is the best shared preferences tutorial I ever found but I have a error, I put it in a fragment and it "works" but when a press the button for take me to the fragment my app closes, I put the debug mode and when a press the button there is a error saying "tv_text don't be null" do you know what can I do? Please help

sebastian
Автор

how i can use auto save score (SharedPreferences) no Button? Thanks

anhtrieuphathuynh