Kotlin

Kotlin Android Development Course for Beginners // ViewBinding + ViewModel + LiveData // MVVM



This is lecture 8 in a 9 week series on mobile app development with Android and Kotlin. In this Kotlin Android development course for beginners, you’ll learn the fundamentals of Android development with Kotlin while building a simple weather app using Android Studio.

This week’s lecture will teach you how to implement simple MVVM using ViewBinding, ViewModel and LiveData.

🤔 This week’s lecture covers the following questions:
– How to use ViewBinding to replace findViewById() calls?
-…

Similar Posts

17 thoughts on “Kotlin Android Development Course for Beginners // ViewBinding + ViewModel + LiveData // MVVM
  1. Sir, I completed this tutorial series, you have my utmost gratitude.

    Some questions though, Isn't it necessary to apply MVVM to CurrentForecastFragment/WeeklyForecastFragment?
    How would it look then? Setting all the observers for the repository live data will move to the viewmodel classes? If it is, then we'd have to pass the views as parameter to the viewmodel constructor to set their visibilty. Is doing so a good practice?

  2. I have followed upto here. I am having great experience . But from part 7 i have lost somewhere. I didn't understand retrofit clearly. And now i am into issue. Though i having call to onCreateOptionsMenu() and onOptionsItemSelected from MainActivity,
    My Menu is not showing in the toolbar. What may be the probable reason?? Please help me out..

  3. This is a very amazing tutorial, if I may say it honestly I started to feel confused when following this series of learning series starting part 7, I found an error in ForecastDetailsFragment in the form of not being able to access args.date and args.icon, I have rebuilded it many times and resetting my android studio but that didn't solve the problem, is there any advice you gave to solve this problem?

  4. Are you sure data binding and MVVM is for beginners? I mean this technologies are pretty handy to use, but they are complex inside… MVVM. It's a design pattern and to understand it you need to be aware of problems, that MVVM solves. And understand why you need Android logic to be separated from data model.

  5. In `onDestroyView `shouldn't the `super.onDestroyView` be called last before the `_binding = null`? This will ensure that everything is cleanup related to the fragment views and resources.

Leave a Reply

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