10. Data Binding

Data binding was announced at Google I/O 2015 as a way to bind an app’s data to the views that display that data in the app. In addition to allowing Android developers to write less boilerplate code, it can speed up code performance. This chapter provides an overview of the data binding library and how it can use used.

The data binding library analyzes view layouts at compile time and generates code that can be used at runtime. This code generation can make some of the view-related tasks that are part of Android development (like calls to findViewById()) obsolete.

Adding Data Binding to an Android Project

Before the data binding API can be used in a project, it must be added to the project. For a Gradle-based Android project, ...

Get Android™ Database Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.