Android MVVM Kotlin Tutorial – LiveData + ViewModel (Android Architecture Components)



📗 Read the written tutorial with all the code 👇👇

Start saving time now by planning weekly with Week Sweep:

Model – View – ViewModel is an architectural pattern which will empower you to write manageable, maintainable, cleaner and testable code. MVVM is also supported and encouraged by Google itself. There are many first-party libraries like lifecycle-aware components, LiveData, ViewModel and many…

40 Comments

  1. Tanx so much Reso coder…. I have a better understanding of Live data and MVVM now…

  2. 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

  3. thanks for being so considerate and 'apologising' for bad sound in the start. I hardly noticed it 🙂

  4. thanks for this wonderful video – should the repo be init with the db and not the dao ? why repo is with constructor with dao?

  5. 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" 🙈👋

  6. ViewModelProviders is Depreciated

    This is how I did it

    val viewModel = ViewModelProvider(

    this@QuotesActivity,

    factory

    ).get(QuotesViewModel::class.java)

  7. I suppose Quote should not be initialized on QuoteActivity cause it directly uses a model. If I'm wrong, please let me know.

  8. 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 ?

  9. Hi i want mvvm with java , data binding , live data with a form and recyclre view and also form should contain major components means text view, edit text, spinner, radio button check box ….. and also dynamic views kindly provide as soon as possible

  10. 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 !

  11. 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?
    🙂

  12. 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

  13. 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?

  14. 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

Leave a Reply

Your email address will not be published. Required fields are marked *