https://kotlinlang.org logo
#android
Title
# android
e

enighma

03/09/2017, 11:44 PM
Does anyone know of a good lightweight reactive library? RxJava is simply to bulky imo.
m

miha-x64

03/10/2017, 8:18 AM
Android has its own reactivity — Broadcasts and BroadcastReceivers. Also, as my collegue suggests: https://github.com/google/agera
z

zak.taccardi

03/10/2017, 9:39 PM
I don't see a reason why one would choose Agera over RxJava2.
e

enighma

03/13/2017, 9:24 PM
The reasons would be that it’s more lightweight, but I don’t know of anyone who has tried it out. @miha-x64 have you tried it out?
m

masc3d

03/14/2017, 12:46 AM
what do you mean by lightweight actually
m

miha-x64

03/14/2017, 7:53 AM
@enighma no, I haven’t.
e

enighma

03/14/2017, 4:03 PM
@masc3d small footprint in terms of size (kb and method count)
m

masc3d

03/14/2017, 4:08 PM
@enighma having proguard this is a debug build concern only, right
e

enighma

03/14/2017, 4:09 PM
@masc3d Using, proguard was one of the solutions. But it’s hard to tell how much of the 600+ kb I can get rid of in a normal project.
m

masc3d

03/14/2017, 4:13 PM
@enighma hm. with
rxjava
becoming the defacto reactive standard for java and more and more building on it (
rxbinding
,
rxlifecycle
etc.) this would probably not be reason enough for me to switch.
e

enighma

03/14/2017, 4:15 PM
Yes, but if you’re building an Android app and want use instant apps and have a limit of 4MB (I think that was the limit) you have to be careful about which libraries you pull in. Especially if they have a large footprint.
m

masc3d

03/14/2017, 4:15 PM
@enighma especially considering those size/method count constraints will become less and less relevant
e

enighma

03/14/2017, 11:22 PM
@masc3d not for instant apps though
m

masc3d

03/14/2017, 11:32 PM
so ~1000 methods and ~220kb including rxkotlin is too bulky
without obfuscation that is even
obfuscation will take off another ~20%, so you’re left with like 180kb
e

enighma

03/15/2017, 3:50 PM
@masc3d isn’t the RxJava jar over 600kb?
m

masc3d

03/15/2017, 3:53 PM
@enighma even larger yes, but proguard brings it down to that size
e

enighma

03/15/2017, 3:54 PM
Yeah, that I understand, but how much depends on how many of the operators you use and I’m curious how many I would use is a standard project.
m

masc3d

03/15/2017, 3:55 PM
that’s true, I took this from a project of mine, so this would probably be a realistic value
a project which uses
rxjava
for REST calls, events and bindings
rxjava-2.x
to be precise. I would expect 2.x to be considerably smaller in size after minimizing as it separates backpressure support into `Flowable`s, which are usually not required for android