Data Binding https://developer.android.com/topic/libraries/data-binding
View Binding https://developer.android.com/topic/libraries/view-binding#java
Note that this strategy is effective as it reduces the processing time. This style does not advise the use of the old approach of referencing views using the famous findViewById() method.
Step 1 Add the below configuration in the gradle.build module -> android tag
Step 2 Design your UI layout file, assuming takes the name activity_main.xml, include the root element into the layout element, for data binding also include the data element with the variable name and type,
the type refers to the class the raw data belongs to (model), see below
Step 3 Now the system auto-generates a binding class corresponding to the name of your UI layout file. Mine is ActivityMainBinding, so in MainActivity.java, I'll declare the instance of this ActivityMainBinding class. Then we need to
connect the inflated layout and the binding utility from this activity
Step 4 We are done, we just use the binding instance to help us access all the data and views without using the ID or any help of findViewById()
Make sure that you follow me on Linkedin.com, here Ndaedzo Phoshoko (FullStack Developer path). Note Views will not be onbind if you do not give them IDs, so take note of this whenever you perform binding for your data with views.