Тёмный

Data Binding with LiveData (Two-way & One-way) - Android Kotlin Tutorial 

Reso Coder
Подписаться 113 тыс.
Просмотров 85 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 97   
@subindsuresh4897
@subindsuresh4897 5 лет назад
What is two-way data binding? 10:37 - 11:02 .Thank you for the awesome tutorial.
@Emsique
@Emsique 5 лет назад
Greeting from Russia! One of the best tutorials I have ever seen!!! The best wishes!
@fuzuyx
@fuzuyx 5 лет назад
been struggling for this thing for days. missing .value and now it work. thanks
@BruceCichowlas
@BruceCichowlas 5 лет назад
I like your explanation style. I couldn't quite get the repository to build, but I was able to transplant the code into another project and run it. I watched quite a lot of videos on two-way binding and read a lot of tutorials, but yours was the clearest and had code I could use. I'll be looking for other topics, like recycleview with databinding, preferably in Kotlin.
@Krush11
@Krush11 Год назад
it is clear an d a calming voice.
@KyawAungWin-Win
@KyawAungWin-Win 6 лет назад
Greeting from Myanmar! Great tutorials... Wish you get more and more subscribers and keep doing that kind of great tutorials!
@andreeagorcsa1812
@andreeagorcsa1812 3 года назад
Thank you and God bless you for making this helpful tutorial!
@LeonardoCostaCoesta
@LeonardoCostaCoesta 4 года назад
Clear and concise tutorial, thanks from Brazil!
@haykmkrtchyan7093
@haykmkrtchyan7093 3 года назад
I'm a big fan of your tutorials)) Also, I've added one more imageView in the XML and created a Binding Adapter. Using that, I'm loading an image using Glide. And for the image URL, I've created an Object, where I store my URL. Then I imported that Constants Object inside XML as and used the URL inside that object to load the image.
@voicheci007
@voicheci007 6 лет назад
Amazing! You are a great teacher
@jaken82
@jaken82 2 года назад
Perfect! Just what I needed.
@tonyalbanese6446
@tonyalbanese6446 4 года назад
Thanks for making this video. You explain this concept excellently! Just perfect.
@alexwijoyong
@alexwijoyong 5 лет назад
Thanks for the information about MutableLiveData for two way data binding.
@PetBuddies
@PetBuddies 2 года назад
I really wanna know which theme of android studion you are using! It looks awesome
@farshaadheydari5807
@farshaadheydari5807 11 месяцев назад
Thanks man , nice video 👍
@Shad0wB0X3r
@Shad0wB0X3r 4 года назад
Is it even needed to use databinding while using kotlin? Woopsies, ur vid description answers my questions
@vladfedos5554
@vladfedos5554 3 года назад
Amazing, thats all i need) thanks
@rahulchandrabhan
@rahulchandrabhan 2 года назад
Awesome video bro, also can you please create playlists on android tutorials.
@luisbaltodano1941
@luisbaltodano1941 4 года назад
Great tutorial , 2w binding is awesome
@codervlogs4921
@codervlogs4921 4 года назад
Great tutorial
@nicovillegas4774
@nicovillegas4774 5 лет назад
Thank you so much your tutorials are so great.
@farazahmed6749
@farazahmed6749 5 лет назад
Hy i just waanna know that displaying image with glide is a two way binding or not
@deepakrattan2328
@deepakrattan2328 4 года назад
Great tutorial.Thanks for the help .
@2004michaelpeer
@2004michaelpeer 4 года назад
Great tutorial, thank you
@polinacoulter4037
@polinacoulter4037 2 года назад
new sub ;) ur dope bro keep it up
@yd13029
@yd13029 5 лет назад
e: error: Bindable must be on a member in an Observable class. MainViewModel is not Observable please help
@begalisydykov6404
@begalisydykov6404 5 лет назад
Remove `@Bindable` annotation. `@Bindable` is used with `Observable`. It'll work.
@lekkalanarayana182
@lekkalanarayana182 3 года назад
How @bindable is working in viewmodel??....when I use same like your code ...it reflecting error.....same issue is raised in stackover flow ....no need to use @bindable just @={viewmodel.edittext} is enough...it will update edittext field in viewmodel.
@AkashJhaDDN
@AkashJhaDDN 5 лет назад
Thank you for your tutorial, it was so clear
@ricindigus
@ricindigus 4 года назад
THANK YOU VERY MUCH!!!!!!!!
@williamrai9911
@williamrai9911 5 лет назад
Bindable must be on a member in an Observable class. I get this error.
@yunuscaglyan417
@yunuscaglyan417 5 лет назад
Extend observer class
@diegovidal7963
@diegovidal7963 6 лет назад
Amazing channel, please keep doing this!!
@ResoCoder
@ResoCoder 6 лет назад
Thank you! I'm not planning to stop anytime soon 😉
@terjemah_alquran
@terjemah_alquran 4 года назад
thank you and autosubscribe after watch this excellent tutorial
@rohitmanohar2733
@rohitmanohar2733 4 года назад
Hi , I have just one doubt , if we have a dataclass having 2 field name and address and that is intialised with Live data then how can we achieve 2 way binding for that,
@christianmengler2169
@christianmengler2169 6 лет назад
Thank you for your great tutorials! I noticed you are using AndroidX package which I had no idea what it was until your tutorial :) Now that this AndroidX package is 1.0.0 production ready as of 21st September, is it recommended to use these over the android.support* packages? Reason I'm also asking is because when using @Bindable in ViewModel the compiler complains about the class not being of Observable which I suspect there may be changes in the new AndroidX package that I'm yet to try to see if it resolves this error...
@ResoCoder
@ResoCoder 6 лет назад
Oh yes! AndroidX is the new android.support. It may be the case that the new ViewModel implements Observable.
@christianmengler2169
@christianmengler2169 6 лет назад
@@ResoCoder Cheers! :) Thanks again for your great content! :)
@shivamkapoor5549
@shivamkapoor5549 5 лет назад
Hi, could you please help me. When I try to bind mutablelivedata-string variable it works fine and I can observe any changes in the activity, however, when I try to bind mutablelivedata of custom model type, I am unable to observe any change to the value of the custom model attribute in my activity.
@mijaelviricocheaparra7474
@mijaelviricocheaparra7474 5 лет назад
Hi, can you tell me how did you configure that theme please?
@bensaidali1670
@bensaidali1670 4 года назад
Good Tutorial but i got an error illegal character at index 0 android
@sreerajvijayan3072
@sreerajvijayan3072 3 года назад
Your voice seems similar to Jiraiya from Naruto series. Only a bit lighter.
@sergio3528
@sergio3528 5 лет назад
Great tutorial, thanks. I have a question though, imagine we wanted to do something else besides modifying 'editTextContent'. For example store in the database every change (just theoretical example). I don´t want an observer observe the field from the Activity, because this is a business action, nothing to do with the view. How could i do this? Is it possible to customize the way the value is set, maybe with a setter method or similar?
@begalisydykov6404
@begalisydykov6404 5 лет назад
Remove @Bindable from ViewModel's MutableLiveData field. It's redundant and causes compile time exceptions.
@Unknown-vk9kd
@Unknown-vk9kd 5 лет назад
thanks a lot
@munierparker
@munierparker 5 лет назад
Hello, thank you for a great video on data binding. Could you please tell me what Theme you are using, I really like it.
@ResoCoder
@ResoCoder 5 лет назад
Material Theme UI
@munierparker
@munierparker 5 лет назад
@@ResoCoder Thank you :)
@tusharpingale2384
@tusharpingale2384 6 лет назад
How to use focus listener on edit text and validate the data after loosing focus on edit text. Any Ideas?
@amilalisahil4661
@amilalisahil4661 5 лет назад
which theme you are using
@abhisheksoni4822
@abhisheksoni4822 6 лет назад
@Reso Coder which version of android studio is you are using ?
@jithinbabumb2355
@jithinbabumb2355 5 лет назад
Thank you, it was great tutorial , but.... how to start or navigate to another activity
@yavgani
@yavgani 5 лет назад
How can I customize my android studio to look like yours?
@avaz.alimov
@avaz.alimov 6 лет назад
I have an issue with @Bindable val editTextContent = MutableLiveData() It gives me an error: Bindable must be on a member in an Observable class.
@christianmengler2169
@christianmengler2169 6 лет назад
I have the same issue, I just noticed the use of the AndroidX package which is something new to me that I only found out about today. I'm wondering if ViewModel has changed in these new packages.
@avaz.alimov
@avaz.alimov 6 лет назад
Actually it's not so much difficult to fix it. I've just created my own ObservableViewModel class which extends the Observable class, and used it in my viewmodel. Then it worked!
@christianmengler2169
@christianmengler2169 6 лет назад
@@avaz.alimov Perfect! I'm interested to find out to see if this is what the new AndroidX package does :)
@frigorifico91
@frigorifico91 5 лет назад
Its not necesari to annotate MutableLiveData with @Bindable, actually MutableLiveData it's not gonna change, just its value and Databinding cares about it
@svoicum
@svoicum 5 лет назад
What color scheme are you using? ^.^
@razanabughazaleh8342
@razanabughazaleh8342 4 года назад
how to read ImageView from ViewModel?
@papanino4415
@papanino4415 5 лет назад
You're holding on to the same state - currentRandomFruitName - in two different places while trying to synchronise between them. There should be a law against that.
@ftrrhmn09
@ftrrhmn09 4 года назад
i can't next step in type="com.resocoder.databinding.MainViewModel" why??? can help me :(
@ftrrhmn09
@ftrrhmn09 4 года назад
7:20
@lakshminarayanacharan837
@lakshminarayanacharan837 3 года назад
Every one will take only text view and edit text for data binding… no one used check box spinner and other important views along with text views
@orhanavan7222
@orhanavan7222 5 лет назад
While textView presenting, you used LiveData instead of MutableLiveData. Why?
@deepakbisht7764
@deepakbisht7764 5 лет назад
because you can only observe changes using Livedata
@orhanavan7222
@orhanavan7222 5 лет назад
@@deepakbisht7764 thx
@farazahmed6749
@farazahmed6749 5 лет назад
becuase live data wont notifiy the ui if the image is changed
@Themusicaligera
@Themusicaligera 6 лет назад
I have a question related with the UI of your Android Studio, how can I implement that UI?
@ResoCoder
@ResoCoder 6 лет назад
I have downloaded a plugin called "Material Theme UI" and I have chosen the "Material Darker" variant. I'm also using Consolas font because I don't like Fira Sans that comes packaged with the plugin.
@Themusicaligera
@Themusicaligera 6 лет назад
thanks!!! By the way amazing channel, I just subscribed and clicked the bell icon!!!!
@ResoCoder
@ResoCoder 6 лет назад
Thank you!
@muhammadfahadkhalid4779
@muhammadfahadkhalid4779 6 лет назад
Good Tutorial, i also use Studio 3.2, but your IDE looks Cool, Why ?
@ResoCoder
@ResoCoder 6 лет назад
Thanks! I'm using this plugin: plugins.jetbrains.com/plugin/8006-material-theme-ui
@muhammadfahadkhalid4779
@muhammadfahadkhalid4779 6 лет назад
Thank you !!! Also done by following www.material-theme.com/docs/getting-started/
@ncmlncml9506
@ncmlncml9506 5 лет назад
how to set spinner using two way data binding ?
@fadialkhachroum9548
@fadialkhachroum9548 5 лет назад
thank you
@DanishKhan-ps3ik
@DanishKhan-ps3ik 5 лет назад
downloaded the source code and it has too many errors in MainActivty.
@AkashJhaDDN
@AkashJhaDDN 5 лет назад
I imported in latest android studio and goes well
@shyiamnot212
@shyiamnot212 4 года назад
The way of writing databing related code in the video is over complicated. 5:47 / 32:04
@abdusalam3ar
@abdusalam3ar 4 года назад
Pro tip: play the video in 1.25x speed!
@Monarch_943
@Monarch_943 6 лет назад
I'v been using ontextchangelistner all the time :/ I didn't know about the @={}. This saves alot of time and a lot cleaner. Dude you are a life saver
@shivamdawar97
@shivamdawar97 6 лет назад
Use diagrams to explain more clearly
@bessermt
@bessermt 5 лет назад
Warning... The two way data binding is broken. It creates extraneous callbacks.
@advancedprogramming62
@advancedprogramming62 5 лет назад
its work but its not perfect
@appranger6639
@appranger6639 3 года назад
This doesn't work anymore. I wasted my time
@herotruth4613
@herotruth4613 6 лет назад
Good, but why would you use MutableLiveData if you think its unsafe. Why not teach people how to do the proper way instead of an unsafe way. Seems irresponsible...
@ResoCoder
@ResoCoder 6 лет назад
It's only as unsafe as the programmer writing the code is irresponsible. There's no way around MutableLiveData when it comes to two-way data binding. That's because the data binding needs to "mutate" the data itself.
@14bbb88
@14bbb88 6 лет назад
expose
@ZulqurnainCodingDiaries
@ZulqurnainCodingDiaries 5 лет назад
you talk too much
@ResoCoder
@ResoCoder 5 лет назад
Thanks!
@EddyCaffrey
@EddyCaffrey 6 лет назад
Great tutorial. Thank you
@ResoCoder
@ResoCoder 6 лет назад
You're welcome!
Далее
If __name__ == "__main__" for Python Developers
8:47
Просмотров 409 тыс.
МЭЙБИ БЭЙБИ - Hit Em Up (DISS)
02:48
Просмотров 287 тыс.
Ванька пошел!!!! 🥰
00:18
Просмотров 234 тыс.
Китайка и Пчелке Холодно😂😆
00:21
Android Data Binding: Getting Started
46:04
Просмотров 97 тыс.
Kotlin Singleton Example with MVVM and Coroutines
36:24
Android ViewBinding in 8 Minutes
8:59
Просмотров 77 тыс.
Kotlin Coroutines 101 - Android Conference Talks
24:49
Просмотров 136 тыс.