This video tutorial is all about the two important Android Architecture Components, namely - ViewModel and LiveData.
We will learn ViewModel and LiveData , and make a simple Word Puzzle app step by step in some upcoming tutorials. As always learning new things along with developing new project is always fun, I hope you will also enjoy it.
Starter Project download link : https://bit.ly/2UmN4bt
MVVM stands for Model, View and View Model.
ViewModel: ViewModel is basically a link between Model and View. Responsible for wrapping the model and preparing observable data needed by the view.
Live Data : In MVVM design pattern we need something to notify any data changes to View and automatically update the UI. We can do this thing using LiveData. LiveData is an android architectural component which works as a wrapper that holds any data. LiveData is an Observable that being observed by the View which means when the data inside the LiveData Changes the View gets notified and UI get refreshed automatically. A major good feature of LiveData is - it is Lifecycle aware. LiveData knows the state of View whether it is in background or foreground. If the View is in background LiveData automatically stops updating the View. So we do not need to manually configure the observer operations. In a nutshell we have the ViewModel which survives the configuration changes and we have observable LiveData that automatically does the right things at the right time and thus saves us from many lifecycle related potential bugs and memory leaks.
Reason to use ViewModel and LiveData-
-Separation of concerns
-Survive runtime configuration change
-Make the code Understandable
-Maintainability of Code
Throughout this tutorial we will learn some intersting things, like -
-ViewModel
-LiveData
-ViewModel Factory
-DataBinding using ViewModel and LiveData
-LiveData Map Transformation
#AndroidViewModel
#AndroidLiveData
#AndroidAppDevelopmentTutorial
#MVVM
#AndroidMVVM
Auf dieser Seite können Sie das Online-Video #1 Android ViewModel and LiveData Tutorial - Android Architecture Component - Jetpack Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Munir Hoque 03 Februar 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,990 Mal angesehen und es wurde von 33 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!