Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devrath/droid-network-observer
Mππππππ ππππππππππππ’ ππππππ πππππ π πππππππππππ ππ ππππ ππππ πππ ππππ ππ’πππ ππππππππ ππ π πππππππππ πππππππππππ πππππππ ππ πππππππ
https://github.com/devrath/droid-network-observer
android connectivity connectivitymanager lifecycleowner livedata
Last synced: about 2 months ago
JSON representation
Mππππππ ππππππππππππ’ ππππππ πππππ π πππππππππππ ππ ππππ ππππ πππ ππππ ππ’πππ ππππππππ ππ π πππππππππ πππππππππππ πππππππ ππ πππππππ
- Host: GitHub
- URL: https://github.com/devrath/droid-network-observer
- Owner: devrath
- License: apache-2.0
- Created: 2022-11-13T13:43:13.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T17:17:32.000Z (11 months ago)
- Last Synced: 2024-07-11T14:46:06.158Z (2 months ago)
- Topics: android, connectivity, connectivitymanager, lifecycleowner, livedata
- Language: Kotlin
- Homepage:
- Size: 2.79 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - devrath/droid-network-observer - Mππππππ ππππππππππππ’ ππππππ πππππ π πππππππππππ ππ ππππ ππππ πππ ππππ ππ’πππ ππππππππ ππ π πππππππππ πππππππππππ πππππππ ππ πππππππ (Kotlin)
README
# droid-network-observer π§β
[![life-cycle-aware](https://img.shields.io/badge/life--cycle--aware-red)](https://developer.android.com/topic/libraries/architecture/lifecycle)
[![Kotlin](https://img.shields.io/badge/connectivity--manager-brightgreen)](https://developer.android.com/reference/android/net/ConnectivityManager)
[![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)
[![Live data](https://img.shields.io/badge/live--data-orange)](https://developer.android.com/topic/libraries/architecture/livedata)
[![Multi module](https://img.shields.io/badge/Multi--Module-blueviolet)](https://developer.android.com/topic/modularization)## **`πππ ππππ`** π
π·οΈ In android projects it is common to communicate with a network and get data from a remote server or post data into remote server.
π·οΈ There is a common case to check connectivity before performing either of the case.
π·οΈ Sometims when the connectivity fails and gets connected, again we need to show a notification just like how youtube does.## **`π·ππ π π ππππ ππ πππππππππ ππ ππππππ’ ππππππππ`** π‘
π·οΈ 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.
π·οΈ And to monitor the connectivity change we used to listen to broadcast from the android system## **`π±πππππ πΈπππππππππππππ`** π‘
π·οΈ 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.
π·οΈ We can store the changes in a variable and just use that to determine the state of the network instead of checking network everytime.
π·οΈ By this way is efficient and less error prone and the is single source of truth for current connectivity state.## **`πΎπππππ`** π§Ώ
## **`πππππππ`** β
If you feel like support me a coffee for my efforts, I would greatly appreciate it.## **`π²πππππππππ`** πββοΈ
Read [contribution guidelines](CONTRIBUTING.md) for more information regarding contribution.## **`π΅πππππππ`** βοΈ
Feature requests are always welcome, [File an issue here](https://github.com/devrath/droid-network-observer/issues/new).## **`π΅πππ ππππ πππππππ ππππππ`** ? β€οΈ
Support it by clicking the β button on the upper right of this page. βοΈ## **`π»ππππππ`** ![Licence](https://img.shields.io/github/license/google/docsy) :credit_card:
This 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