Android library for internet connection detection with callbacks.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.Rupesh-Saxena:InternetConnectionChecker-Android:1.0'
}
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
//check internet connection and perform action
new InternetConnection(this, new InternetConnectionListener() {
@Override
public void onInternetConnectionEnable() {
//TODO PERFORM TASKS ON INTERNET CONNECTION ENABLE
....
}
@Override
public void onInternetConnectionDisable() {
//TODO PERFORM TASKS ON INTERNET CONNECTION DISABLE
....
}
});