Home > OS >  Alternative to data binding in Android?
Alternative to data binding in Android?

Time:10-25

So I'm picking up Android dev again after 5 years break. While I now write my app in Jetpack compose, I learned that I might be going back to a project with Fragment/XML layout soon and I'm trying to do my homework.

I heard that some people aren't a fan of data binding and I can agree - mixing business logic in XML, too much boilerplate code, and slow compile.

In my last project back in 2017, we used ButterKnife (now deprecated) so I've never used data binding personally. My question is, if they're not using data binding, then what do people use to do reactive layout with XML and LiveData/flow? Is there some sort of library? Or is data binding your only option?

CodePudding user response:

Data Binding is multi-direction way, you can set and get inside and from your view, if you want an unidirectional way you can use view Binding, if you want to learn more about it see the link below.

view binding

CodePudding user response:

If you want to build UI dynamically I would suggest to look into Compose https://developer.android.com/jetpack/compose.

This is the newest guy in the hood.

  • Related