Data Binding with LiveData (Two-way & One-way) – Android Kotlin Tutorial
Managing the layout programmatically can be quite time consuming and verbose on Android. Even though Kotlin spares you of calling findViewById, accessing views in the activity code can still get ugly. When you use data binding, you can do most of the UI related stuff right in the XML layouts.
With LiveData, data binding becomes even more powerful and simple to use. While you could create observable fields even in the past when LiveData didn’t exist, this new life-cycle aware observable makes data binding even better and simpler.
In this tutorial you are going to learn how to use one-way and two-way data binding with LiveData and MVVM architecture.