{"id":13610218,"url":"https://github.com/jasmingrbo/internet-availability","last_synced_at":"2025-04-12T22:33:12.439Z","repository":{"id":48176807,"uuid":"515048870","full_name":"jasmingrbo/internet-availability","owner":"jasmingrbo","description":"An Android library that allows for internet availability observation","archived":false,"fork":false,"pushed_at":"2024-12-23T20:37:29.000Z","size":140,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-23T21:29:03.827Z","etag":null,"topics":[],"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/jasmingrbo.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":"2022-07-18T05:39:20.000Z","updated_at":"2024-12-23T20:37:32.000Z","dependencies_parsed_at":"2024-11-07T16:36:58.446Z","dependency_job_id":"af704a02-1b6d-40d7-b862-27410841afa8","html_url":"https://github.com/jasmingrbo/internet-availability","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/jasmingrbo%2Finternet-availability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasmingrbo%2Finternet-availability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasmingrbo%2Finternet-availability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasmingrbo%2Finternet-availability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasmingrbo","download_url":"https://codeload.github.com/jasmingrbo/internet-availability/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248641663,"owners_count":21138244,"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":[],"created_at":"2024-08-01T19:01:42.577Z","updated_at":"2025-04-12T22:33:12.064Z","avatar_url":"https://github.com/jasmingrbo.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"Internet availability\n=====================\n\nAn Android library that allows for internet availability observation.\n\nHow it works\n------------\n\n- Internet capable networks are observed and a URL is *pinged* through them. Each time a network \nchange happens *pings* are made using currently enabled networks.\n- When *pinging* the precedence is given to **non-metered** networks, so **no metered networks get\npinged** in case internet availability is detected on a non-metered network.\n- Besides *pings* that happen on each network change, additional *pings* can happen in given \nintervals to continuously keep checking for internet availability.\n- **Observation and *pinging* start on the first `availability` collector and stop 5s after the \nlast collector completes.**\n\nHow to use\n----------\nInstantiate an `Internet` instance and collect from its `availability` flow in a **lifecycle-aware**\nmanner.\n\n    val internet = Internet.getInstance(\n        scope, // Application CoroutineScope\n        pingUrl = \"https://www.google.com\", // A url to be pinged\n        pingTimeoutMillis = 2_000, // Ping timeout\n        pingRetryTimes = 0, // How many times to retry pinging\n        pingRetryIntervalMillis= 0, // Delay between each ping retry\n        pingOnNonMeteredNetworks = true, // Should pinging happen on non-metered networks\n        nonMeteredNetworksPingIntervalMillis= 10_000, // Delay between each ping on non-metered networks\n        pingOnMeteredNetworks = true, // Should pinging happen on metered networks\n        meteredNetworksPingIntervalMillis = 10_000, // Delay between each ping on metered networks\n        context: Context // Application Context\n    )\n\n\n**Check out the `sample` app to see it in action.**\n\nDownload\n--------\n```groovy\nrepositories {\n  mavenCentral()\n}\n\ndependencies {\n  implementation \"io.github.jasmingrbo:internet-availability:1.0.1\"\n}\n```\n\nLicense\n-------\n    Copyright 2022 Jasmin Grbo\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n        http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\nRead the full [license](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasmingrbo%2Finternet-availability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasmingrbo%2Finternet-availability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasmingrbo%2Finternet-availability/lists"}