
Lightweight library offers a unified API for monitoring network connectivity, delivering real-time updates, network type detection, and platform-specific insights across multiple platforms.
NetworkObserver is a lightweight Kotlin Multiplatform (KMP) library for Compose Multiplatform. It provides a simple, unified API to monitor network connectivity across Android, iOS, Desktop (JVM), and Web/Wasm, with real-time updates and platform-specific insights.
| Android | iOS | Web | Desktop |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Note: For Web/Wasm, Gradle will manage the toolchain; no manual Node setup is typically required.
Add NetworkObserver to your multiplatform project by depending on it from commonMain.
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.tarifchakder:networkobserver:<latest-version>")
}
}
}
}[versions]
networkObserver = "1.0.6" # use latest version
[libraries]
network-observer = { module = "com.tarifchakder:networkobserver", version.ref = "networkObserver" }MaterialTheme {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center
) {
val status by networkObserverAsState()
Text("Status: $status")
val networkType by networkTypeAsState()
Text("Network type: $networkType")
}
}Key APIs are defined in commonMain (e.g., Ext.kt and NetworkObserver.kt) and backed by platform-specific implementations.
Use the Gradle Wrapper from the repository root.
Build everything:
Android (sample):
Desktop (JVM):
Web/Wasm:
iOS:
See also the GitHub Action for releases: .github/workflows/release.yml
Issues and PRs are welcome! If youβd like to add features or fix bugs, please open an issue first so we can discuss scope and approach.
This project is distributed under the MIT License. See LICENSE for details.
NetworkObserver is a lightweight Kotlin Multiplatform (KMP) library for Compose Multiplatform. It provides a simple, unified API to monitor network connectivity across Android, iOS, Desktop (JVM), and Web/Wasm, with real-time updates and platform-specific insights.
| Android | iOS | Web | Desktop |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Note: For Web/Wasm, Gradle will manage the toolchain; no manual Node setup is typically required.
Add NetworkObserver to your multiplatform project by depending on it from commonMain.
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.tarifchakder:networkobserver:<latest-version>")
}
}
}
}[versions]
networkObserver = "1.0.6" # use latest version
[libraries]
network-observer = { module = "com.tarifchakder:networkobserver", version.ref = "networkObserver" }MaterialTheme {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center
) {
val status by networkObserverAsState()
Text("Status: $status")
val networkType by networkTypeAsState()
Text("Network type: $networkType")
}
}Key APIs are defined in commonMain (e.g., Ext.kt and NetworkObserver.kt) and backed by platform-specific implementations.
Use the Gradle Wrapper from the repository root.
Build everything:
Android (sample):
Desktop (JVM):
Web/Wasm:
iOS:
See also the GitHub Action for releases: .github/workflows/release.yml
Issues and PRs are welcome! If youβd like to add features or fix bugs, please open an issue first so we can discuss scope and approach.
This project is distributed under the MIT License. See LICENSE for details.