{"id":17225430,"url":"https://github.com/rommansabbir/networkx","last_synced_at":"2025-04-14T00:53:34.936Z","repository":{"id":40512328,"uuid":"282722534","full_name":"rommansabbir/NetworkX","owner":"rommansabbir","description":"🅽🅴🆃🆆🅾🆁🅺🆇 An easy \u0026 handy library to monitor device internet connection status.","archived":false,"fork":false,"pushed_at":"2022-11-27T06:50:36.000Z","size":223,"stargazers_count":98,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T04:37:13.499Z","etag":null,"topics":["coroutines","coroutines-android","internet-connection","networkx"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rommansabbir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-26T19:52:42.000Z","updated_at":"2024-06-03T06:26:12.000Z","dependencies_parsed_at":"2023-01-21T05:00:16.857Z","dependency_job_id":null,"html_url":"https://github.com/rommansabbir/NetworkX","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FNetworkX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FNetworkX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FNetworkX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rommansabbir%2FNetworkX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rommansabbir","download_url":"https://codeload.github.com/rommansabbir/NetworkX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804784,"owners_count":21164131,"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":["coroutines","coroutines-android","internet-connection","networkx"],"created_at":"2024-10-15T04:13:31.613Z","updated_at":"2025-04-14T00:53:34.917Z","avatar_url":"https://github.com/rommansabbir.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"![NetworkX](https://user-images.githubusercontent.com/25950083/185731068-480fd969-f18d-439c-938a-6285a50c2be2.png)\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://android-arsenal.com/details/1/8160\"\u003e\u003cimg alt=\"Maintained\" src=\"https://img.shields.io/badge/Android%20Arsenal-NetworkX-green.svg?style=flat\" height=\"20\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n \u003cp align=\"center\"\u003e\n     \u003ca href=\"https://github.com/rommansabbir/NetworkX\"\u003e\u003cimg alt=\"Maintained\" src=\"https://img.shields.io/badge/Maintained_Actively%3F-Yes-green.svg\" height=\"20\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n \u003cp align=\"center\"\u003e\n     \u003ca href=\"https://jitpack.io/#rommansabbir/NetworkX\"\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/JitPack-Yes-green.svg?style=flat\" height=\"20\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e ⚡ Latest Version: 4.2.0 | Change Logs 🔰\u003c/h1\u003e\n\n- NetworkX now works with both __Activity__ or __Application__ Scope (NetworkX lifecycle is bounded to `NetworkXLifecycle.Activity` or `NetworkXLifecycle.Application`).\n- Introduced `SmartConfig` to replace old config [`NetworkXConfig` has been deprecated].\n- New __API__ to initialize `NetworkX`, enabled smart refactoring to replace old __API__ with new one.\n- New __API__ [`NoInternetDialogV2.forceClose()`] added to close `Dialog` forcefully.\n- Added support for custom _Drawable_ to be shown in `NoInternetDialogV2`.\n- Added support for _No Internet Dialog_ `JetPack Compose` version.\n- Several __Classes__, __APIs__ has been deprecated.\n- Removed unused classes/packages.\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n\u003ch1 align=\"center\"\u003eInstallation\u003c/h1\u003e\n\n## ➤ Step 1:\n\nAdd the JitPack repository to your build file .\n\n```gradle\n    allprojects {\n        repositories {\n            maven { url 'https://jitpack.io' }\n        }\n    }\n```\n\n## ➤ Step 2:\n\nAdd the dependency.\n\n```gradle\n    dependencies {\n            implementation 'com.github.rommansabbir:NetworkX:4.2.0'\n    }\n```\n\n## ➤ Step 3:\nInitialize `NetworkX` from your `Application.onCreate()`\n````\n    //Deprecated way\n    val builder = NetworkXConfig.Builder()\n        .withApplication(this)\n        // You can disable speed meter if not required\n        .withEnableSpeedMeter(true)\n        .build()\n    NetworkXProvider.enable(builder)\n\n    //New smart way\n    NetworkXProvider.enable(SmartConfig(this, true, NetworkXLifecycle.Application))\n````\n\n## ➤ Step 4:\n- To check Internet Connection status, simply call extension variable\n`isInternetConnected` or `isInternetConnectedLiveData` or `isInternetConnectedFlow`.\n````\n    isInternetConnectedFlow.collectLatest {\n        lifecycleScope.launch {\n                textView.text = \"Internet connection status: $it\"\n            }\n        }\n````\n\n- To get connected network speed/last known speed [`LastKnownSpeed`] call extension variable\n`lastKnownSpeed` or `lastKnownSpeedLiveData` or `lastKnownSpeedFlow`\n\n````\n    lastKnownSpeed?.let {\n        textView2.text =\"S-${it.speed}|T-${it.networkTypeNetwork}|SS-${it.simplifiedSpeed}\"\n    }\n````\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n\n\u003ch1 align=\"center\"\u003eNoInternetDialogV2\u003c/h1\u003e\n\n- Show Dialog\n```kotlin\n    NoInternetDialogV2(\n        activity = WeakReference(this@MainActivity),\n        title = \"No Internet Bro\",\n        message = \"This is just a dummy message\",\n        buttonTitle = \"Okay\",\n        isCancelable = true\n    ) { /* Button Presses */ }\n```\n- Close Dialog (Forcefully)\n\n```kotlin\n    NoInternetDialogV2.forceClose()\n```\n- Determine if the `NoInternetDialogV2` is currently visible or not.\n\n```kotlin\n    NoInternetDialogV2.isVisible\n```\n\n- Show Dialog (Compose Version)\n\n```kotlin\n    val ui = defaultNoInternetUI()\n    NoInternetDialogCompose(\n      true,\n      ui,\n      { /*Dialog Cancelled*/ },\n      { /*Dialog closed by user, by pressing action button*/ }\n    )\n```\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n\n\u003ch1 align=\"center\"\u003eNotes:\u003c/h1\u003e\n\n - **NetworkX** (including **Speed Meter**) can work on both **Application** scope or **Activity** scope. If scope is **Activity**, NetworkX will *start/release* it's components based on _ActivityLifecycleCallback_ (**onCreate - onDestroy**). Else, it will *start* it's components only once and there will be no components *release* event.\n - To emit (**`MutableStateFlow`**) **Last Known Speed** or **Internet Connection Status**,required **`CoroutineScope`** works under a **`Dispatchers.IO`** context.\n - The default value for **Internet Connection Status** is `false`.\n - The default value for **LastKnownSpeed** is `NONE`.\n\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n## Contact me\n\n✔ [LinkedIn](https://www.linkedin.com/in/rommansabbir/)\n\n✔ [Website](https://rommansabbir.com)\n\n\n[![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png)](#getting-started-quick)\n\n### License\n\n[Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\n````html\nCopyright (C) 2022 Romman Sabbir\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frommansabbir%2Fnetworkx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frommansabbir%2Fnetworkx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frommansabbir%2Fnetworkx/lists"}