The BEST MVVM TUTORIAL on the planet for beginners. I wish I had a teacher like you when I was in college. Thank you, sir.
@tonyblack19813 жыл бұрын
I absolutely love way you explain the purpose for everything you are doing throughout your tutorial. I'm subscribing. I don't want to speak too soon, but maybe you're the tutor I've been looking for to help me make sense of android dev. Thumbs up.
@mitchellthornton12236 жыл бұрын
You're the best. I'd love to see you do a design pattern series. I have trouble understanding how to link everything together and the reasons behind design patterns
@ResoCoder6 жыл бұрын
Thank you! I will make a full Android app series using MVVM pattern. I might do a comparison between different architectural patterns but I don't promise anything 😄
@ryanbennett68014 жыл бұрын
Best Android explanation channel on KZbin.
@verryondrums5 жыл бұрын
I wish I had discovered this tutorial 2 weeks ago. Would have saved me a lot of time...! Thanks anyway, really good explanations and examples !
@henriquedesouza4125 жыл бұрын
Just amazing, I was looking for something like this a long time ago ! Greetings from Brazil
@G3me0S3 жыл бұрын
Aqui é BR!
@henriquefigueiredo40773 жыл бұрын
Aqui tb é BR
@BinaryBenevolence2 жыл бұрын
this is great tutorial ! learning how to use mvvm in android app. glad that I found it early
@AdilKhalil4 жыл бұрын
thanks for being so considerate and 'apologising' for bad sound in the start. I hardly noticed it :)
@hellespont50724 жыл бұрын
Incredible tutorial!! Thank you so much for making this, you are an amazing teacher! I am currently making an app that handles the shopping in a retail store (for the people who physically shop or "pick" the items that are delivered to your house). I made a basic desktop version using java and MVC, but after seeing how well you put this together I am definitely going to use Kotlin and the MVVM techniques you have shown here. Much appreciated! Subscribed :D
@alextroy6054 жыл бұрын
Thank you, you are really simple explained the difference module: dao, repos, vm, vmf, and use that in Activity )) That's not simple to understand that when you are reading the manual by himself. Three time "addQuote" 🙈👋
@davidmfra6 жыл бұрын
Hey. @14:00 on your database singleton you could have used the lazy delegate, like this: val instance = lazy{ FakeDatabase()} also it's a good practice to not use this for the lock, use a private object for locking,so people cannot have access to your lock outside.
@dragossusi6 жыл бұрын
or you can use object instead of class
@davidmfra6 жыл бұрын
@@dragossusi yes, you would keep the Singleton logic, but loose the lazyness
@mohsenss87915 жыл бұрын
I've seen twice but still some interesting points to learn.
@matt-g-recovers3 жыл бұрын
I have used this as reference last couple years when I forget this or that. It's a great crash course and quick reference. I love the DI from scratch @27:20
@patrickstens27796 жыл бұрын
Great video! What colour scheme/font are you using? Really like the colours. Edit: It's the Material UI Theme Plugin with color scheme set to Material Darker
@michaelgidron5 жыл бұрын
Sweet .. thanks :-)
@berkc53234 жыл бұрын
and which font is it?
@nandomkumchi43774 жыл бұрын
Tanx so much Reso coder.... I have a better understanding of Live data and MVVM now...
@kingmarwat3 жыл бұрын
amaaaaaazing. teaching method. well done, awesome
@dival99634 жыл бұрын
Really awesome video! It would be nice to provide an advanced implementation like this, combining mvvm with services, where data are driven from services to a database
@michalrv30665 жыл бұрын
great tutorial, best android tutorial quality I've seen on youtube so far
@remali263 жыл бұрын
Everyone if you want to rename something press the word you want to rename and then press shift+F6 and then enter. Or press right click refactor -> rename.
@nsansa92342 жыл бұрын
I think not using Room DB and making it fake DB made it more confusing
@savaramkiran6 жыл бұрын
Excellent tutor, required full tutorial explaining hitting REST API, Local Storage, Repository, ViewModel, View
@dhivabanyuwigara74065 жыл бұрын
Nice tutorial, hope you do LiveData + ViewModel + DataBinding on later video, and thanks!
@TheAiSaEr6 жыл бұрын
Thank you! :) Great explanation! And your voice is so nice!
@anthonyporter73905 жыл бұрын
Third video i've watched today. Amazing work!
@asadmukhtar15 жыл бұрын
Great video! What colour scheme/font are you using? Really like the colours?
@LoldemortII3 жыл бұрын
I love you!! This is just what I needed to progress!
@MultiBuzzTube4 жыл бұрын
thanks for this wonderful video - should the repo be init with the db and not the dao ? why repo is with constructor with dao?
@Enshaedn5 жыл бұрын
Thank you for the video. It has helped me understand MVVM better though I still feel like I need more practice with it. Specifically related to actually connecting with a database. I was wondering if any of your other videos/tutorials explain connecting with Firestore. Would it be made via calls / queries in the Repository class or would you still have a Database class which instantiates the DB connection and makes the queries? Firestore also allows listeners for data changes so I don't understand if LiveData should be used as well or if it matters. Using Firestore also seems like Room wouldn't need to be used. Is that correct?
@moritziseke96586 жыл бұрын
13:24 you can simply use "object FakeDatabase {...}" to create a singleton
@amrh42596 жыл бұрын
the same question
@JessintaFernandes Жыл бұрын
Thank you very much Sir, Great tutorial ...
@cs-ope Жыл бұрын
You are an awesome guy my friend!
@SabbathJoe89v24 жыл бұрын
Best video about the argument!!!
@navdeepbrar35262 жыл бұрын
How did the code recognize textview, edittext, and button's XML ids without databinding or findviewbyid in QuotesAcitvity?
@adravel2 жыл бұрын
It's possible using Kotlin synthetics, but the plugin (Kotlin Android Extensions) is now deprecated
@ralphordanza34875 жыл бұрын
You earned a new subscriber! Thank you so much man!
@shrikantdevarmani94735 жыл бұрын
Understandable content with easy explanation. Ty
@samha15136 жыл бұрын
I am completely lost in these classes and repository and fakedatabase. What's the best way to learn mvvm?
@ResoCoder6 жыл бұрын
Maybe you'd benefit from my tutorial series where we build a real MVVM app for weather forecasts.
@samha15136 жыл бұрын
@@ResoCoder thanks I am following those and it's good so far.
@ralphGabbbbbb5 жыл бұрын
@@ResoCoder What is that series ? I want to check that
@heavysoccer78626 жыл бұрын
Your tutorials are really very helpful. Thanks man.
@dreb.77602 жыл бұрын
Great tutorial, many thanks
@gerardpalma80063 жыл бұрын
I think that you can use the DI to create the Singleton instance for some of your classes
@khanhsb15 Жыл бұрын
Thanks so much, it's helpful !
@DjangoMx5 жыл бұрын
Great video but i have a question, for each view model i have to create a viewmodel factory? because in the video you only create one for the only one viewmodel you have
@raghav_achari4 жыл бұрын
how did he set listener to the button with just id?? i mean without findViewById().... and also accessed other ui elements with just id.. how??
Great video! Can you also make a video on Dependency injection for beginners?
@ResoCoder6 жыл бұрын
Yes! I will publish it this Friday 😉
@voicheci0076 жыл бұрын
@@ResoCoder Great! Thanks a lot! Looking forward to the video
@jktan57936 жыл бұрын
yes dagger2!!!
@adibazhar11155 жыл бұрын
Hi, I familiar with android studio in Java but new in Kotlin...what is the basic things u can suggest before I start to learn about MVVM ? like coroutines, room, etc ?
@joshthiele84165 жыл бұрын
Excellent video. I'm new to development, so i could be totally wrong, but shouldn't the business logic be in the ViewModel, and not in the View? :)
@Since10594 жыл бұрын
It's really good tutorial for learning thanks bro
@roasters943 Жыл бұрын
Wonderful tutorial
@danildv20014 жыл бұрын
Awesome tutorial!! Thank u!
@soulduse6 жыл бұрын
Thank you so much. Your explain is so nice and helpful for me !
@amrh42596 жыл бұрын
Great tutorial, I prefer if you can draw a sample flow graph just to make it easier for you and for us too many thanks
@CiaphasCain214 жыл бұрын
Thanks! That was really helpful to me
@ezscootrr4 жыл бұрын
Do you have tutorials for MVVM when using Firebase?
@pd67326 жыл бұрын
Thanks for the video. Have been doing android stuff for quite some time now, but never follwed any particular design patters because the apps were for personal use only. Btw. what color scheme/font are you using? Kinda reminds me of default atom colors. cheers
@ResoCoder6 жыл бұрын
Yes, the need for patterns comes after a few finished projects :D I'm using "Material Darker" theme. It's a plugin for Android Studio. The font is Consolas.
@ashiqurrahmantahmid96344 жыл бұрын
Amazing ! It's so helpful
@elpirato54283 жыл бұрын
thx, best short tutorial
@OmerFarukUcer2 жыл бұрын
I still can't understand the topic.I try to learn MVVM architecture using in an app but still can't understand why we use this kind of different usages.I mean it's like there is no logic.How can I learn it easily?I tried my best but still can't understand the liveData or MVVM architechture :(
@jollibeecheese4 жыл бұрын
I suppose Quote should not be initialized on QuoteActivity cause it directly uses a model. If I'm wrong, please let me know.
@VinayKumar-mb3ge5 жыл бұрын
keep adding more videos.Thanks
@mohsenss87915 жыл бұрын
Thanks. I've learned so much.
@LordOfTheBing4 жыл бұрын
23:10 if your QuoteViewModel is only passing along the repos's method, it is an useless intermediate. In this case, you can work on the repo directly instead of adding complexity for the sake of it.
@md.naimurrahman24662 жыл бұрын
Just amazing!
@EL-cb1nu4 жыл бұрын
I dont understand why at 16:58 the FakeDatabase object is no inheriting FakeDatabaseDao, but rather is creating FakeDatabaseDao as a new object?
@CiaphasCain214 жыл бұрын
Thanks!! Your tutorial was realy helpful
@jktan57936 жыл бұрын
Hi, very nice and updated tutorial. Can you add dagger2 and retrofit (web service) in this project tutorial too ?
@ResoCoder6 жыл бұрын
Thanks. I will publish a tutorial on MVVM and Kodein which is a dependency injection framework built for Kotlin. I'm also currently preparing a whole tutorial series where we'll be using Retrofit2, Room and more. Stay tuned 😃
@jktan57936 жыл бұрын
Thank you so much. Love the way you teaching, and also your sound is really clear and good =) Can't wait for them haha. Thank you once again !!!
@mohsenss87915 жыл бұрын
In case of a chat app that we have two models, if we have just one repository which gives data to all view models, it does not make sense. Because all the functions we have in the repository is accessible in any view models. For example, we can get a list of groups in user viewmodel. So what can we do for this problem?
@mankesh_mishra4 жыл бұрын
Great Video (cheers) Thanks for the tutorial. :D
@ziweiguo78216 жыл бұрын
Thinks for your video, but I have a question: how to initialize view without invoking "findViewById" method?
@fabrizziocht6 жыл бұрын
When I have many entities, should I create a repository for each one? For example, if I have the Post and Blog entities, each with its own DAO, I could implement a repository for each one, but in a real application I may need both at the same time in a synchronizeAll () method. How can I solve this?
@cwssoftware35885 жыл бұрын
Please create videos on testing
@abdulhakeemmahmood54636 жыл бұрын
hey @6:50 , why override the toString method in kotlin data class? data class does that by default, right?
@advancedprogramming625 жыл бұрын
Yes it's, but for easy understanding u can override it
@blackkingblackjack33252 жыл бұрын
I encounter an unsresolved reference issue in the QuotesActivity when I reference the textView or editText, any idea why? I get unrseolved reference and variable expected
@blackkingblackjack33252 жыл бұрын
other than this, no errors in the code showing up
@voicheci0076 жыл бұрын
Hi Matej! Can you do another tutorial like this but with a real DAO (Room library) and a real web service you can call? This is a bit confusing. Thank you for understanding
@ResoCoder6 жыл бұрын
Sure! Check out my new videos. I'm doing a tutorial series where we're building a real world forecast mvvm app.
@kamala1326 жыл бұрын
Amazing tutorial mate, thanks a lot for it! Could you please explain how do I plug a real db in this pattern? I m using normal sqlite with Anko library
@ResoCoder6 жыл бұрын
Thanks! Have you considered using the Room library? Even if not, watch my newest tutorial series. The last part is about creating a database.
@OurPastSecrets5 жыл бұрын
I'm confused at the distinction of DAO and Repository - I always thought of them as the same thing. Your implementation of Respository just calls the DAO.getQuotes() or DAO.addQuote() so why the extra layer
@MateusMeurer3 жыл бұрын
Oh fuck me twice, seriously? I know the good practices are here to better our lives but damn, he already have like 4 packages and 6 classes and I'm halfway through the tutorial and this is a simple quote app. Thank you for the tutorial btw very clear =)
@dogukangoktas6933 жыл бұрын
09:00 I can't use mutableListOf() What can ı do?
@sanaebadi975 жыл бұрын
do u have mvvm tutorial with java ?
@sadzolot25 жыл бұрын
Nice fonts in Android Studio , what`s name?
@pembatamang82335 жыл бұрын
is a singleton class needed for the repository even in real apps?
@nkheart45 жыл бұрын
If who want to run the code but don't want to write by your self. This is the code that I write from this tutorial. Some command I change it to the latest Kotlin version. github.com/heart/Android-MVVM-Kotlin
@tigranbabajanyan8425 жыл бұрын
Why not used ROOM annotations?
@krishnachinya6 жыл бұрын
very helpful. can you do the same tutorial using Java
@ResoCoder6 жыл бұрын
I technically could but Kotlin is the way to go 😉
@krishnachinya6 жыл бұрын
Yeah, but most companies don't switch to kotlin from java. its rework and there is not much advantage in switching in terms of performance or support. at the end of the day both codes are converted into bytecode.
@ProjectNullTheGame6 жыл бұрын
I think this volitale and sync is unneccessary because we have lazy pattern for kotlin...
@pembatamang82335 жыл бұрын
your Android Studio looks like Visual Studio
@bricktop540317 күн бұрын
Using Fake database was a pretty bad idea here. Makes it so much confusing with terms QuoteDao, FakeDatabase, FakeQuoteDao
@holofox666 жыл бұрын
Thanks you. I wait this tutorial.
@cwssoftware35885 жыл бұрын
can you make a video on testing
@ProGaming-kb9io3 жыл бұрын
ViewModelProvider(this, factory)
@joshuasingleton92973 жыл бұрын
This is so underrated. Thank you!
@tubebility6 жыл бұрын
This line is failing > implementation "androidx.lifecycle:lifecycle-extensions:2.0.0-rc01" Android Studio 3.2.1
@tubebility6 жыл бұрын
After researching the components website, I learn that you now have to specify the viewmodel and livedata extensions separately. _implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0'_ _implementation 'androidx.lifecycle:lifecycle-livedata:2.0.0'_
@TikTokTrendsCompilation6 жыл бұрын
how do you have that dark theme of AS?
@MinhTran-xn3kk5 жыл бұрын
hello. how to make code beautiful like this :))
@shaikhaaves66456 жыл бұрын
which version of android studio are you using?
@ResoCoder6 жыл бұрын
I'm currently using version 3.3 Canary 6.
@shaikhaaves66456 жыл бұрын
Thanks!
@shaikhaaves66456 жыл бұрын
Thanks! My android studio does not support android jetpack navigation! Please give me suggestion
@ResoCoder6 жыл бұрын
Well, if you install the latest 3.3 canary version, it will work.
@shaikhaaves66456 жыл бұрын
Thanks for your suggestion, i just did it and it actually worked! Thanks! Can you please make a video on Repository + Navigation + Retrofit + ViewModel + RecyclerView!!!!! Please do make one!
@eesaaphilips92716 жыл бұрын
What theme are you using for the android studio ide?
@kaustubhtrivedi54036 жыл бұрын
dracula
@tejasjani25443 жыл бұрын
nice video. I am from java background. what the hell🤯 is going on with Syntax.
@hamzamateen78273 жыл бұрын
I swear i had the same reaction :( I used Java more than a year ago
@ProjectNullTheGame6 жыл бұрын
where is the code?
@АкимДанилов-к2е4 жыл бұрын
Thank you!!!
@agung.k5 жыл бұрын
What if FakeDatabase class is not declared as a "class", but as an "object" instead?
@advancedprogramming625 жыл бұрын
Just try, it's not possible
@witoldsienski17096 жыл бұрын
Very good video
@this-is-bioman3 жыл бұрын
The actual content of wiring-up the view with the model begins at 30:00. I find the FakeQuoteDao is overengineered not only for this example but in general. There should be only a repository exposing an interface so that you can exchange the repository. The way you did it creates unnecessary repetitions where you end up with three (!) methods named getQuotes. This tutorial is also too long. Mixing dependency injection and all the factories etc here makes it difficult to follow. The focus should have been just to wire-up the model with the view which could have been done in less than 8 minutes :-\
@dentor20054 жыл бұрын
Memory LEAK. As for me it's not a good idea to receive LiveData from repository directly (through ViewModel) to Layout / Activvity / Fragment. Because you don't know how much time it will take to the DataBase to execute your query. It should be asynchronous task. That's why you should wait in ViewModel the answer from the Repository DB and then using switchMap replace the answer (LiveData ) from Repository to LiveData that is intended for your Layout. Summary: Get data from DB to ViewModel and if Activity / Fragment AND put the answer to the new LiveData that will be received in Activity / Frament. Why? Because user can run some task that needs DB data (REST API for example), and without waiting for the end of execution exit from Application or switched to another Activity / Fragment.