A simple util and example of how to track connectivity changes in Android applications.
Port to RxJava2
In Android Manifest add
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Call to receive stream
RxNetwork.stream(context)
or
RxNetwork.flow(context)
- RxJava 1 (https://github.com/Laimiux/rxnetwork-android)
compile 'com.laimiux.rxnetwork:rxnetwork:0.0.4'
compile 'cn.jingzhuan.lib:rxnetwork:1.0.0'