A simple library to check internet every time using Broadcast Receiver like same as Youtube (online,offline)
Add this dependency to the app build.gradle file:
dependencies {
implementation 'com.github.rrsaikat:ConnectionStatusLikeYoutube:v1.0.1'
}
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Sync & build with net connection.
Finally just declare this two lines into your onCreate() or onStart() method:
NetworkChangeReceiver changeReceiver = new NetworkChangeReceiver(this);
changeReceiver.build();
To handle errors or use this library you have to migrate your android.support into androidx . See the full project migration process at here: Click Me``
- 1.0.1:
- Latest library used of Snacky & add support for android P.
- 1.0.0:
- Custom snackbar added.
- Use last version of Android studio 3.2.1
Copyright 2018 Md. rezwan rabbi
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.