I’ve recently released ReactiveNetwork. It is an open-source Android library listening network connection state and change of the WiFi signal strength with RxJava Observables. It’s a successor of Network Events library rewritten with Reactive Programming approach.
Library is compatible with RxJava 1.0.+ and RxAndroid 1.0.+ and uses them under the hood. Min Android SDK version is 9.
JavaDoc can be found at: http://pwittchen.github.io/ReactiveNetwork.
Repository is available at: https://github.com/pwittchen/ReactiveNetwork.
This library is much simpler and easier to use than NetworkEvents. Even code-base is much smaller, but we have to remember that it utilizes powerful RxJava and RxAndroid. RxJava hase huge API and gives a lot of possibilities. That’s why I was able to obtain desired result with fewer lines of code.
Basic library usage is quite simple. E.g if we want to monitor
OFFLINE), we can create the following subscription, which is quite familiar for software developers who already know RxJava:
When we want to monitor available WiFi Access Points and we want to get fresh list of them whenever strength of the WiFi Access Points signal changes (e.g. when we are moving with a mobile device around), we can use the following code snippet:
If you want to use ReactiveNetwork in your project, add the following dependency to your
Find more in the GitHub repository of the project at: https://github.com/pwittchen/ReactiveNetwork.
I hope you will find it useful and you will make your apps more reactive!
Feel free to fork the library. Any feedback is welcome as usual.