Data Binding is really easy and can save you from a lot of boilerplate when connecting your data to the UI, and also to update it when something changes.

Here I show you an example from scratch, and how to apply it to the MVVM presentation pattern:

Data Binding, easy to learn and really powerful

You’re probably already tired of using findViewById, or maybe Kotlin Android Extensions worked for you for some time, but now you’re finding some edgy cases where you are missing some things.

Thanks to Data Binding, you’ll be able to do a strict match between the views in your XML and the properties in your binding object so that it doesn’t happen anymore.

Besides, if you’re using MVVM pattern, thanks to the integration with LiveData, listening to model changes will be a breeze. Let’s get ready in seconds!

And if you want to learn Kotlin from scratch, join my free training

Shares

Want to learn Kotlin?

Check my free guide to create your first project in 15 minutes!

Shares
%d bloggers like this: