Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
raheemadamboev authored May 8, 2022
1 parent 90a9f2f commit 1ea89a9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Include below dependency in build.gradle of application and sync it:
implementation 'com.github.raheemadamboev:check-internet-android:1.1'
```

**Check internet connection:**
**Check internet connection (callback API):**
```kotlin
CheckInternet().check { connected ->
if (connected) {
Expand All @@ -31,6 +31,19 @@ CheckInternet().check { connected ->
}
}
```

**Check internet connection (suspend API):**
```kotlin
viewmodelScope.launch {
val connected = CheckInternet().check()
if (connected) {
// there is internet
} else {
// there is no internet
}
}
```

## Demo application

Checked internet connection via wifi and mobile network. <a href="https://github.com/raheemadamboev/check-internet-android/blob/master/app-debug.apk">Download demo</a>
Expand Down

0 comments on commit 1ea89a9

Please sign in to comment.