ReactiveX / RxAndroid

RxJava bindings for Android
Apache License 2.0
19.89k stars 2.94k forks source link

Do we need to add rxjava2 dependency when adding rxandroid dependency? #433

Closed gongzelong0718 closed 6 years ago

gongzelong0718 commented 6 years ago

I noticed that even if we do not introduce rxjava2 dependency and only add rxandroid dependency, it works well when I deal with network request and response with retrofit and okhttp.

I can also use operators of rxjava.

So what is the relationship with rxjava and rxandroid?

I am an Android developer.Is it not necessary to add rxjava together with rxandroid? In this way I can reduce the size of app and method count.

Or I am wrong?

RxAndroid still relies upon 1.0.13 of RxJava. If you however specify a new rxjava dependency that one will be overridden. As you can see here 1.0.13 -> 1.1.0

From the README:

// Because RxAndroid releases are few and far between, it is recommended you also // explicitly depend on RxJava's latest version for bug fixes and new features.

So every time I need to add two dependency.

gongzelong0718 commented 6 years ago

How can we see that RxAndroid still relies the lower version of RxJava?

JakeWharton commented 6 years ago

Both dependencies are required. We do not track RxJava releases.