{"id":22916421,"url":"https://github.com/kdroidfilter/androidnetworkwatcher","last_synced_at":"2026-04-24T16:37:17.595Z","repository":{"id":267177201,"uuid":"900466361","full_name":"kdroidFilter/AndroidNetworkWatcher","owner":"kdroidFilter","description":"Network Watcher is a lightweight Android utility class that provides easy-to-use network connectivity monitoring. It helps developers track network connection changes and determine the current network type with minimal setup.","archived":false,"fork":false,"pushed_at":"2024-12-08T21:18:50.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T07:31:48.777Z","etag":null,"topics":["android","android-development","connectivity","network-monitoring","network-status","real-time-monitoring","utility-library"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/io.github.kdroidfilter/netwatcher","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kdroidFilter.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-08T20:50:21.000Z","updated_at":"2024-12-08T21:21:35.000Z","dependencies_parsed_at":"2024-12-08T21:34:56.121Z","dependency_job_id":"fbae3be6-dc21-4dea-9c97-00a7610f48ed","html_url":"https://github.com/kdroidFilter/AndroidNetworkWatcher","commit_stats":null,"previous_names":["kdroidfilter/netwatcher"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FAndroidNetworkWatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FAndroidNetworkWatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FAndroidNetworkWatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdroidFilter%2FAndroidNetworkWatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdroidFilter","download_url":"https://codeload.github.com/kdroidFilter/AndroidNetworkWatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246642113,"owners_count":20810548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-development","connectivity","network-monitoring","network-status","real-time-monitoring","utility-library"],"created_at":"2024-12-14T06:12:46.582Z","updated_at":"2026-04-24T16:37:17.553Z","avatar_url":"https://github.com/kdroidFilter.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 Android Network Watcher (ConnectivityMonitor)\n\n## 📝 Overview\n\nAndroid Network Watcher is a lightweight Android utility class that provides easy-to-use network connectivity monitoring. It helps developers track network connection changes and determine the current network type with minimal setup.\n\n## ⭐ Features\n\n- ⚡ Real-time network connectivity monitoring\n- 🌍 Supports multiple network types:\n  - 📶 WiFi\n  - 📱 Cellular\n  - 🖧 Ethernet\n- 🛠️ Compatible with Android versions from API level 23 and above\n- 🔔 Simple callback mechanism for network state changes\n- 🔄 Handles both network availability and type changes\n\n## 📥 Installation\n\nAdd the `ConnectivityMonitor.kt` file to your Android project's source directory.\n\n### Gradle Dependency\n\nAdd the following dependency to your `build.gradle.kts` file:\n\n```kotlin\nimplementation(\"io.github.kdroidfilter:netwatcher:0.1.0\")\n```\n\n## 💻 Usage Example\n\n```kotlin\nclass YourActivity : AppCompatActivity(), ConnectivityMonitor.ConnectivityListener {\n    private lateinit var connectivityMonitor: ConnectivityMonitor\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        connectivityMonitor = ConnectivityMonitor(this, this)\n        connectivityMonitor.startMonitoring()\n    }\n\n    // Implement the connectivity listener\n    override fun onNetworkConnectionChanged(isConnected: Boolean, networkType: ConnectivityMonitor.NetworkType) {\n        when {\n            isConnected -\u003e {\n                when (networkType) {\n                    ConnectivityMonitor.NetworkType.WIFI -\u003e\n                        println(\"Connected to WiFi\")\n                    ConnectivityMonitor.NetworkType.CELLULAR -\u003e\n                        println(\"Connected to Cellular Network\")\n                    ConnectivityMonitor.NetworkType.ETHERNET -\u003e\n                        println(\"Connected to Ethernet\")\n                    else -\u003e println(\"Connected to Unknown Network\")\n                }\n            }\n            else -\u003e println(\"No network connection\")\n        }\n    }\n\n    override fun onDestroy() {\n        connectivityMonitor.stopMonitoring()\n        super.onDestroy()\n    }\n}\n```\n\n## 🛠️ Methods\n\n### 🔍 `startMonitoring()`\n\nBegins monitoring network connectivity changes. Immediately triggers an initial callback with the current network state.\n\n### 🛑 `stopMonitoring()`\n\nStops monitoring network connectivity and unregisters the network callback.\n\n## 📡 Network Types\n\nThe library supports the following network types:\n\n- 📶 `WIFI`: WiFi network connection\n- 📱 `CELLULAR`: Mobile data network\n- 🖧 `ETHERNET`: Ethernet network\n- 🚫 `NONE`: No network connection\n- ❓ `UNKNOWN`: Unrecognized network type\n\n## 📋 Compatibility\n\n- Minimum Android SDK: 23\n\n## ⚖️ License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdroidfilter%2Fandroidnetworkwatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdroidfilter%2Fandroidnetworkwatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdroidfilter%2Fandroidnetworkwatcher/lists"}