Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netflix vs ReactiveX RxJava-Android library

Quick question: I'm playing with RxJava for the first time. The writers of the tutorials I've seen all dive into how to use it, but none of them have talked about the differences between the ReactiveX and Netflix versions of the libraries. And to confuse things, the mvnrepository link to the Netfix GitHub redirects to ReactiveX:

  • https://github.com/Netflix/RxJava
  • https://github.com/ReactiveX/RxJava

So, some tutorials say to do this:

dependencies {
    compile 'io.reactivex:rxandroid:1.0.1'
    compile 'io.reactivex:rxjava:1.0.16'
}

And others say to do this:

dependencies {
    compile 'com.netflix.rxjava:rxjava-core:0.20.7'
    compile 'com.netflix.rxjava:rxjava-android:0.20.7'
}

Even different answers on the same SO question seem to use the two interchangeably:

  • https://stackoverflow.com/a/22909505/4151208
  • https://stackoverflow.com/a/32972674/4151208

And clearly they're not the same. I found that the AndroidObservable class was not available in the ReactiveX version. Only the Netflix version. Obviously the version numbers are different...

I'm I missing something? Is this just a lack of clarity in the documentation I've been reading? Am I reading the wrong documentation? Can someone point me to a good place that I can RTFM in regards to the above?

like image 666
Michael De Soto Avatar asked Nov 16 '15 00:11

Michael De Soto


1 Answers

They are the same library. Versions < 1.0.0 had com.netflix.rxjava groupId, but 1.0.0 and above have the io.reactivex groupId. See this changelog item. To get the latest and most stable, you want to be using the reactivex groupId.

AndroidObservable was deprecated and removed at some point, which is why it only exists in older versions.

Tutorials that refer to the netflix version were likely written awhile ago and have not been updated.

like image 82
iagreen Avatar answered Sep 22 '22 08:09

iagreen