{"id":13609222,"url":"https://github.com/devrath/droid-network-observer","last_synced_at":"2025-04-12T19:33:31.304Z","repository":{"id":83285376,"uuid":"565461204","full_name":"devrath/droid-network-observer","owner":"devrath","description":"M𝚘𝚗𝚒𝚝𝚘𝚛 𝚌𝚘𝚗𝚗𝚎𝚌𝚝𝚒𝚟𝚒𝚝𝚢 𝚌𝚑𝚊𝚗𝚐𝚎 𝚞𝚜𝚒𝚗𝚐 𝚊 𝚌𝚘𝚖𝚋𝚒𝚗𝚊𝚝𝚒𝚘𝚗 𝚘𝚏 𝚕𝚒𝚟𝚎 𝚍𝚊𝚝𝚊 𝚊𝚗𝚍 𝚕𝚒𝚏𝚎 𝚌𝚢𝚌𝚕𝚎 𝚘𝚋𝚜𝚎𝚛𝚟𝚎𝚛 𝚒𝚗 𝚊 𝚖𝚞𝚕𝚝𝚒𝚖𝚘𝚍𝚎 𝚊𝚙𝚙𝚕𝚒𝚌𝚊𝚝𝚒𝚘𝚗 𝚜𝚒𝚖𝚒𝚕𝚊𝚛 𝚝𝚘 𝚈𝚘𝚞𝚃𝚞𝚋𝚎","archived":false,"fork":false,"pushed_at":"2023-10-11T17:17:32.000Z","size":2927,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T15:43:57.477Z","etag":null,"topics":["android","connectivity","connectivitymanager","lifecycleowner","livedata"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devrath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2022-11-13T13:43:13.000Z","updated_at":"2024-05-28T07:34:01.000Z","dependencies_parsed_at":"2023-10-11T19:39:52.523Z","dependency_job_id":null,"html_url":"https://github.com/devrath/droid-network-observer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrath%2Fdroid-network-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrath%2Fdroid-network-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrath%2Fdroid-network-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devrath%2Fdroid-network-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devrath","download_url":"https://codeload.github.com/devrath/droid-network-observer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248621514,"owners_count":21134868,"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","connectivity","connectivitymanager","lifecycleowner","livedata"],"created_at":"2024-08-01T19:01:33.388Z","updated_at":"2025-04-12T19:33:30.790Z","avatar_url":"https://github.com/devrath.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/devrath"],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/devrath/devrath/blob/master/images/kotlin_logo.png\" align=\"right\" title=\"Kotlin Logo\" width=\"120\"\u003e\n\n# droid-network-observer 🧞‍\n[![life-cycle-aware](https://img.shields.io/badge/life--cycle--aware-red)](https://developer.android.com/topic/libraries/architecture/lifecycle) \n[![Kotlin](https://img.shields.io/badge/connectivity--manager-brightgreen)](https://developer.android.com/reference/android/net/ConnectivityManager)\n[![Coroutines](https://img.shields.io/badge/Coroutines-1.6.0-red)](https://kotlinlang.org/docs/reference/coroutines-overview.html) [![DaggerHilt](https://img.shields.io/badge/DaggerHilt-2.40-blue)](https://developer.android.com/training/dependency-injection/hilt-android)\n[![Live data](https://img.shields.io/badge/live--data-orange)](https://developer.android.com/topic/libraries/architecture/livedata)\n[![Multi module](https://img.shields.io/badge/Multi--Module-blueviolet)](https://developer.android.com/topic/modularization)\n\n## **`𝚄𝚜𝚎 𝚌𝚊𝚜𝚎`** 🚀\n🏷️ In android projects it is common to communicate with a network and get data from a remote server or post data into remote server. \u003c/br\u003e\n🏷️ There is a common case to check connectivity before performing either of the case. \u003c/br\u003e\n🏷️ Sometims when the connectivity fails and gets connected, again we need to show a notification just like how youtube does. \u003c/br\u003e\n\n## **`𝙷𝚘𝚠 𝚠𝚎 𝚞𝚜𝚎𝚍 𝚝𝚘 𝚒𝚖𝚙𝚕𝚎𝚖𝚎𝚗𝚝 𝚒𝚗 𝚕𝚎𝚐𝚊𝚌𝚢 𝚙𝚛𝚘𝚓𝚎𝚌𝚝𝚜`** 💡\n🏷️ Everytime we used to call a API, we check connectivity and say if we have multiple API's, we do the same check multiple times. \u003c/br\u003e\n🏷️ And to monitor the connectivity change we used to listen to broadcast from the android system\u003c/br\u003e\n\n## **`𝙱𝚎𝚝𝚝𝚎𝚛 𝙸𝚖𝚙𝚕𝚎𝚖𝚎𝚗𝚝𝚊𝚝𝚒𝚘𝚗`** 💡\n🏷️ With the introduction of live data and the life-cycle observers, we can have a better implementation to monitor and react to the network changes. \u003c/br\u003e\n🏷️ We can store the changes in a variable and just use that to determine the state of the network instead of checking network everytime. \u003c/br\u003e\n🏷️ By this way is efficient and less error prone and the is single source of truth for current connectivity state. \u003c/br\u003e\n\n## **`𝙾𝚞𝚝𝚙𝚞𝚝`** 🧿\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/devrath/droid-network-observer/blob/main/assets/recording.gif\" width=\"220\" height=\"460\"/\u003e\n\u003c/p\u003e\n\n## **`𝚂𝚞𝚙𝚙𝚘𝚛𝚝`** ☕\nIf you feel like support me a coffee for my efforts, I would greatly appreciate it.\u003c/br\u003e\n\u003ca href=\"https://www.buymeacoffee.com/devrath\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n## **`𝙲𝚘𝚗𝚝𝚛𝚒𝚋𝚞𝚝𝚎`** 🙋‍♂️\nRead [contribution guidelines](CONTRIBUTING.md) for more information regarding contribution.\n\n## **`𝙵𝚎𝚎𝚍𝚋𝚊𝚌𝚔`** ✍️ \nFeature requests are always welcome, [File an issue here](https://github.com/devrath/droid-network-observer/issues/new).\n\n## **`𝙵𝚒𝚗𝚍 𝚝𝚑𝚒𝚜 𝚙𝚛𝚘𝚓𝚎𝚌𝚝 𝚞𝚜𝚎𝚏𝚞𝚕`** ? ❤️\nSupport it by clicking the ⭐ button on the upper right of this page. ✌️\n\n## **`𝙻𝚒𝚌𝚎𝚗𝚜𝚎`** ![Licence](https://img.shields.io/github/license/google/docsy) :credit_card:\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/devrath/droid-network-observer/blob/main/LICENSE) file for details\n\n\n\u003cp align=\"center\"\u003e\n\u003ca\u003e\u003cimg src=\"https://forthebadge.com/images/badges/built-for-android.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevrath%2Fdroid-network-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevrath%2Fdroid-network-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevrath%2Fdroid-network-observer/lists"}