Advanced Data Binding in Android: Observables

Learn how to use the Data Binding Library to bind UI elements in your XML layouts to data sources in your app using LiveData and StateFlow. By Husayn Hakeem.

5 (4) · 1 Review

Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Where to Go From Here?

Download the final project using the Download Materials button at the top or bottom of the tutorial.

Congratulations! You learned how to use one of data binding’s most important features: observability. You saw how to set up your data sources to be observable using either LiveData or StateFlow, and you also learned how to make different types of data observable, from primitives to collections and complex objects. Finally, you saw how to set up observable data sources that expose transformed data from other sources.

If you need to brush up on data binding, check out Data Binding in Android: Getting Started. If, instead, you’d like to see how data binding fits in with other architectural patterns in Android, check out MVVM and DataBinding: Android Design Patterns.

We hope you enjoyed this tutorial! If you have any questions or comments, please join the forum discussion below.