5

What are some pros and cons of using RoboBinding vs Android Binding.

eg.

  1. can RoboBinding be used on fragments ?
  2. What about Android binding for fragments ?
  3. Does any use reflection to slow down Android at run time ?
  4. Also which ones can be obfuscated with proguard ?
  5. Can any of the two auto generate a viewModel interface ?

Android Binding info

RoboBinding cast

Akeshwar Jha
  • 4,516
  • 8
  • 52
  • 91
j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • Just wonder how auto-generating a viewModel interface will help? you are highly welcomed to post any ideas to RoboBinding github issue or google group, so that we can discuss and implement them if they are helpful. – Cheng Jul 24 '15 at 21:38

4 Answers4

1

I didn't use Android Binding, but have some experience with robobinding

  1. yes, quite seemlessly
  2. don't know
  3. I didn't notice any problems with forms binding up to 30 properties
  4. to some extent. you have to preserve all PM properties you bind to, constructors and annotations
  5. no

please note that robobinding is not working well with material design and is not working at all with AppCompat 22+

avestnik
  • 150
  • 4
  • 8
  • AppCompat 22+ introduced a incompatibility in LayoutInflater.setFactory. It is fixed now. @dbis, just wonder how RoboBinding can help with material design? if you have any ideas, please do post them into github issue or google group, so that we can discuss further. RoboBinding highly appreciates it. Thanks. – Cheng Jul 24 '15 at 21:44
1

I've used both and although I like RoboBinding (I even have some contributions to the code) I've switched to Data Binding for all my binding needs.

http://developer.android.com/tools/data-binding/guide.html

It doesn't have some of the bi-directional binding goodness that I like in RoboBinding but it's really solid at this point and from Google directly. It allows you to do some pretty cool stuff

Here's a post I have that goes into Data binding as well as other stuff

http://blog.liffft.com/2016/01/19/rx-java-spock-groovy-android-bindings-android-might-now-be-testable-say-what/

Joachim
  • 2,761
  • 1
  • 15
  • 7
0

May I also suggest Anvil (https://github.com/zserge/anvil)? The whole library API is only ~10 most important methods. Inspired by React.js.

No reflection used (other than creating views, but XML inflaters use that as well). Can be used with Proguard, but it's only ~100KB when unstripped, so I normally use with without Proguard. Best used with Kotlin, but also supports Java 6/8.

And if you're familiar with React and are looking for Redux implementation - here's one I normally use with Anvil: https://github.com/trikita/jedux

zserge
  • 2,212
  • 2
  • 31
  • 40
0

Just want to let people know who may have Googled this as I did today, that RoboBinding is no longer maintained.

Some alternatives could be RoboMVVM or Anvil, but not sure if either of those are maintained either (last commits were in 2014 and 2019 respectively).

At this point I think the safest option is to use Android Data Binding directly, then you don't have dependencies on third-party frameworks that you might have to remove later. And Android Data Binding does now support two-way data binding, contrary to one of the other answers here.

Adam Burley
  • 5,551
  • 4
  • 51
  • 72