Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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πš˜πš—πš’πšπš˜πš› πšŒπš˜πš—πš—πšŽπšŒπšπš’πšŸπš’πšπš’ πšŒπš‘πšŠπš—πšπšŽ πšžπšœπš’πš—πš 𝚊 πšŒπš˜πš–πš‹πš’πš—πšŠπšπš’πš˜πš— 𝚘𝚏 πš•πš’πšŸπšŽ 𝚍𝚊𝚝𝚊 πšŠπš—πš πš•πš’πšπšŽ πšŒπš’πšŒπš•πšŽ πš˜πš‹πšœπšŽπš›πšŸπšŽπš› πš’πš— 𝚊 πš–πšžπš•πšπš’πš–πš˜πšπšŽ πšŠπš™πš™πš•πš’πšŒπšŠπšπš’πš˜πš— πšœπš’πš–πš’πš•πšŠπš› 𝚝𝚘 πšˆπš˜πšžπšƒπšžπš‹πšŽ

Awesome Lists containing this project

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.
Buy Me A Coffee

## **`π™²πš˜πš—πšπš›πš’πš‹πšžπšπšŽ`** πŸ™‹β€β™‚οΈ
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