Jetpack DataStore is Google's newer recommended solution for key-value storage. If you're developing a new Android app, you should consider using it instead of SharedPreferences: developer.android.com/topic/libraries/architecture/datastore
@akashkhatkale11492 жыл бұрын
So much of in depth industry level knowledge in one video 🙌🏻 please continue uploading such videos
@typealias Жыл бұрын
Thanks so much, Akash! I'll keep at it! 🙂
@akashkhatkale1149 Жыл бұрын
KZbin lacks advance android knowledge like the one shown in your video. All the best :)
@shubhamnanche2 ай бұрын
You are doing a great job, Dave! Bravo!
@jessehill46582 жыл бұрын
This was a great way to see delegates in action and also an interesting example of working with generics + reified. Thanks for putting it together!
@typealias2 жыл бұрын
You're most welcome, Jesse! I'm glad you liked it!
@wagnerarcieri Жыл бұрын
best content on kotlin I've ever found, congrats! Please more!
@typealias Жыл бұрын
Wow, thanks so much for the kind words!
@vengateshm2122 Жыл бұрын
Thanks for the detailed explanation of different approaches. Expecting more videos from you on Kotlin programming.
@typealias Жыл бұрын
You're most welcome! And yes, more videos coming!
@Carlos-xz9zq2 жыл бұрын
I really liked the type video, nice work, going to check more!
@typealias2 жыл бұрын
Thanks Carlos! I've only created a handful of videos so far, but I'm glad to hear that you enjoyed this one!
@behnamahmadi28347 ай бұрын
great Explanation, just found your channel and subscribed immediately.
@typealias7 ай бұрын
Hey, that's fantastic! Thank you so much!
@AndreiBacalu Жыл бұрын
somehow youtube recommended me this video which is awesome. i'm looking forward to see more videos from you, but in the meantime you got me as a subscriber.
@typealias Жыл бұрын
Sounds great, Andrei! Thanks for subscribing! 🙂
@Namesake..20 күн бұрын
Great video. Thanks for this! It would be interesting to see how you would unit test this code.
@jackli1924 Жыл бұрын
amazing video! You explained it concise and step by step, from easy to hard. Thanks a lot bro you inspired me a lot
@typealias Жыл бұрын
Thanks so much Jack! 🙂
@h4m74ro Жыл бұрын
This is really great content! I already learned so much. I wish you all the best and hope you will make more videos 🙂
@typealias Жыл бұрын
Thank you so much. I'm glad to hear! And yes, more videos will be coming!
@waelalghamdi52982 жыл бұрын
As usual, a great video 👍
@typealias2 жыл бұрын
Thanks so much! Glad you enjoyed it! 🙂
@aiklklivlind9451 Жыл бұрын
Very interesting and good presentation of the material. Keep up the good work. Good luck! subscription
@typealias Жыл бұрын
Many thanks, Мaikl!
@PeteC625 ай бұрын
Nice video! When i have to do a comparison of the sort you did between the Boolean and Float delegates, I'll copy one version into the clipboard, select the other version, and then use Compare Clipboard to Selection (I think thats the name, I'm on my phone away from my laptop!)
@typealias5 ай бұрын
Thanks Pete! Yeah, that's a handy feature! I love using it when I'm developing but it didn't occur to me to use it for the video! 😅
@derekdevs Жыл бұрын
This is incredible. Thank you!
@typealias Жыл бұрын
You're most welcome, Derek! Thanks for your kind words!
@aungkhanthtoo76787 ай бұрын
So insightful!
@BewareOfStinger5 ай бұрын
Amazing video as always. I was wondering if there is something similar that is not specific to Android?
@typealias5 ай бұрын
I've heard of Multiplatform Settings (github.com/russhwolf/multiplatform-settings), but I don't have any experience with it myself. It supports Android, iOS, macOS, watchOS, tvOS, JavaScript, JVM, and Windows - and looks like its API supports delegates. Might be worth checking out!
@etherxi11 ай бұрын
Really nice and helpful idea
@typealias11 ай бұрын
Thanks so much! I'm glad you like it!
@skytech25012 жыл бұрын
One of the best explainer videos! something like this for a Sqlite Database !?
@typealias2 жыл бұрын
Thanks Sky Tech! Just to clarify - are you asking about using delegated properties with SQLite, or are you just asking for an explainer video about SQLite in general?
@MuhammadAwais-hc6ry2 ай бұрын
Just awesome 🎉
@typealias2 ай бұрын
Hey, thanks so much, Muhammad! I appreciate that!
@rajeshpattanaik6597 Жыл бұрын
Love your videos ❤
@typealias Жыл бұрын
Thanks so much, Rajesh! 🙂
@mdisi5967 Жыл бұрын
That was super informative, Thank you!
@typealias Жыл бұрын
You're most welcome! Glad you enjoyed it!
@ztao39078 ай бұрын
nice!!!
@safionweb Жыл бұрын
Amazing!
@rohitjakhar6672 Жыл бұрын
Great video, please make more video
@typealias Жыл бұрын
Thanks so much! More videos are on the way!
@lg.studio9 ай бұрын
Thanks for the information. How can I make my list automatically save to the shared preferences again when an item is removed or added to it? I have been struggling to find a solution for this problem. Thanks.
@typealias9 ай бұрын
Hey, LG, thanks for asking! Is this a list of strings, where you're saving the whole list to SharedPreferences (e.g., using putStringSet()), or are you trying to save individual items of the list as individual values, or something else...? Creating your own implementation of `MutableList` is a likely option, but it might help to see some example code to understand your particular situation better.
@lg.studio9 ай бұрын
@@typealias I would like to store a list of strings/ids (10-12 character long ones). dynamically add and remove from the list, search in the list for matching ID, and want them to be stored in the shared prefs all the time, as it is quite an important data I need during runtime. I was able to create the one you have, but this way I have to create and copy all existing items into a new list and assign it to my variable.
@typealias8 ай бұрын
Okay, thanks. You could consider extending AbstractMutableSet with your own class, e.g., named SharedPreferencesSet. Its constructor could accept an instance of SharedPreferences and the key. It would also hold a private instance of an underlying mutable set. Then, the modification functions (e.g., add/remove/etc.) would be overridden to call the same function on the private instance _and also_ save the set to shared preferences. Would definitely need some good testing to make sure it works as expected. Hopefully the description above is enough to give you the idea, but if you need more info, just send me a direct message on X, LinkedIn, or Kotlin Slack.
@cal13146 ай бұрын
For the overloading of getters problem, would @JvmName be an appropriate solution?
@typealias6 ай бұрын
That can work in certain cases, like when you've got a generic with a type argument as a function parameter (or as a receiver on an extension function). In the example in this video, there just aren't any parameters that can be used to distinguish between the functions. In other words, the clash isn't just for the JVM platform; it's a clash in Kotlin, regardless of the platform you're targeting. It was a good thought, though!
@deepakshah3108 Жыл бұрын
Could you make videos on Difference between videos like -> Extension fun vs Delegates
@typealias Жыл бұрын
Hey, Deepak, thanks for the suggestion! Just to clarify, are you looking for videos that explain the trade-offs between different design decisions? (e.g., "when should I use an extension function, and when should I use a delegate?")
@deepakshah3108 Жыл бұрын
@@typealias Yes, it will help us to get deeper knowledge(may be for interview purpose)
@typealias Жыл бұрын
Great, thanks again! 👍
@lglf77 Жыл бұрын
make one video with sharefPreferences in fragment without to user Activity.
@roman3249 Жыл бұрын
🔥
@scottbiggs88945 ай бұрын
Excellent explanation of delegates. However this is not really "easy" once you get past the initial version. SharedPrefs are quite easy to use--I fail to see the need for all this complicated code to do something that already works well and is straight-forward.
@TerryQuiet Жыл бұрын
whoa
@mohamednizam5298 Жыл бұрын
Forgive me are u somehow related to sheldon cooper? P/s great vid thanks
@typealias Жыл бұрын
Haha, I'm tall and slender, but not nearly smart enough to be related to Sheldon! Glad you enjoyed the video!
@igorshaula90975 ай бұрын
a good example of delegation in the very beginning of this video! but what goes after - is a sample of over-engineering, to my mind. I'm sorry for that, but this wrapping of SP leads only to useless complications of code with no real benefits. again - thanks for the video, this one, and for the content on this channel! you give really great lessons about Kotlin mastery! the line above concerns only the given approach to SP.
@typealias5 ай бұрын
Hey Igor, I'm glad you've been enjoying the videos! I can certainly respect your conclusion that the first, simpler approach is adequate. It's fun to explore the possibilities, and getting to full type-safety is a nice idea, but not always worth the cost at the usage site. Got diminishing returns trying to get the last little bit of type safety on this one, for sure!
@dmytroberezhnyi717 Жыл бұрын
Man, you are a wizard! How to do that? kzbin.info/www/bejne/gXfKk2miZrWIgKs
@typealias Жыл бұрын
Thanks Dmytro! I was using the "Add Selection for Next Occurrence" keyboard shortcut for multiple cursors. Here's the documentation about it: www.jetbrains.com/help/idea/multicursor.html?#multiple_words
@Adam00012 жыл бұрын
That's amazing Thank you Can we use delegation with Flow? (Kotlin Coroutines) Instead of return Flow we return the value Like the way collectAsState() works with in JetpackCompose I hope you understood me Keep going 👏
@typealias2 жыл бұрын
Hey, thanks Adam! If I understand right, you're looking for a way to use a delegated property to connect a Flow so that it always gives you the latest value when you evaluate it. If that's what you're looking for, I slapped together an example of that here: gist.github.com/djleeds/716f3acbd94b8e4367ab66ba403778d7 Keep in mind that I only have limited experience with Flow so far... so someone else might be able to comment on a better way to achieve this... or maybe the coroutines core library might even give us something similar to this out of the box... ?
@ahmedel-hady32497 ай бұрын
if I am not mistaken Mutablestateflow.collectAsState() does that