3

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.

?Get the code from this tutorial?

 

Matej Rešetár
 

Matej is an app developer with a knack for teaching others. If he's not programming, making tutorials or doing other business, he's mostly working out, listening to audiobooks and taking cold showers.

  • KAREL GRONDIN FOUCAULT says:

    l

  • Ujwal says:

    Verry good tutorial with best explaination

  • >