pwittchen / ReactiveNetwork

Android library listening network connection state and Internet connectivity with RxJava Observables
http://pwittchen.github.io/ReactiveNetwork/docs/RxJava2.x/
Apache License 2.0
2.53k stars 273 forks source link

Update to RxJava 2.0.0 #80

Closed epicstar closed 7 years ago

epicstar commented 8 years ago

I think it may be time to update ReactiveNetwork to use RxJava 2.x.

RxJava 2.0.0 RC1 is now out: https://github.com/ReactiveX/RxJava/releases/tag/v2.0.0-RC1

In addition, RxAndroid 2.0.0 RC1 is also out: https://github.com/ReactiveX/RxAndroid/releases/tag/2.0.0-RC1

I haven't looked at the new version, but how much effort is it to update ReactiveNetwork to use RxJava 2.0.0?

pwittchen commented 8 years ago

I know about RC release of RxJava 2.0.0, but I haven't taken a look on that and its release notes. I'll check it out and write more detailed information about the future upgrade.

pwittchen commented 8 years ago

Resources, which may be useful during library migration to RxJava 2.0:

I think, we can work on migration on a separate git branch, but new release of the library, when RxJava will be officially released and will be no longer RC.

pwittchen commented 8 years ago

I've created branch RxJava2.x. I'll be working on this branch in order to prepare the library for RxJava 2.x.

pwittchen commented 8 years ago

We need to upgrade RxAndroid at the same time as well: https://github.com/ReactiveX/RxAndroid/releases/tag/2.0.0-RC1.

pwittchen commented 8 years ago

As far as I see, it won't be that easy to rewrite library code to RxJava2. They removed and renamed a lot of methods and classes in the public API, so I need to dig deep into code and documentation, to migrate library correctly. I started migration locally today, but it's not going as smoothly as I expected, so it may take some time. It also needs to be tested afterwards.

Rainer-Lang commented 8 years ago

Maybe this helps https://medium.com/@amitshekhar/migrating-from-rxjava1-to-rxjava2-5dac0a94b4aa

pwittchen commented 8 years ago

Hello again everyone,

I migrated library code and sample apps to RxJava 2.0.0-RC1 and RxAndroid 2.0.0-RC1. Currently, this is experimental code as both RxJava and RxAndroid are Release Candidates. If you want to test it or check it out, see RxJava2.x branch in this repository. Commit related to mentioned migration is linked above this message.

Regards, Piotr

tushar-nallan commented 7 years ago

@pwittchen I've raised a pull request with latest changes at #164 Let me know if you want any changes there.

pwittchen commented 7 years ago

Hi @tushar-acharya,

Thanks for the comment. I wrote a response in your PR.

pwittchen commented 7 years ago

It's done. ReactiveNetwork with support for RxJava2.x will be available in the next release as a separate artifact reactivenetwork-rx2. Now it's available on RxJava2.x branch.