{"id":19775477,"url":"https://github.com/rishabh115/covidmapper","last_synced_at":"2026-04-30T12:31:27.016Z","repository":{"id":201290367,"uuid":"249815342","full_name":"rishabh115/CovidMapper","owner":"rishabh115","description":"A minimal library for getting Covid-19 data of all the countries fetched from worldmeters.info .  Leverages Retrofit and Jsoup under the hood.","archived":false,"fork":false,"pushed_at":"2020-10-01T11:20:57.000Z","size":311,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T01:31:05.745Z","etag":null,"topics":["android","android-library","coronavirus-tracking","covid-19","covid-api","hacktoberfest2020","java","jsoup","kotlin","minimal","retrofit2"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rishabh115.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}},"created_at":"2020-03-24T20:52:02.000Z","updated_at":"2023-11-07T12:54:00.000Z","dependencies_parsed_at":"2024-03-21T00:45:47.086Z","dependency_job_id":null,"html_url":"https://github.com/rishabh115/CovidMapper","commit_stats":null,"previous_names":["rishabh115/covidmapper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh115%2FCovidMapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh115%2FCovidMapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh115%2FCovidMapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rishabh115%2FCovidMapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rishabh115","download_url":"https://codeload.github.com/rishabh115/CovidMapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241105930,"owners_count":19910719,"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","android-library","coronavirus-tracking","covid-19","covid-api","hacktoberfest2020","java","jsoup","kotlin","minimal","retrofit2"],"created_at":"2024-11-12T05:16:20.636Z","updated_at":"2026-04-30T12:31:21.977Z","avatar_url":"https://github.com/rishabh115.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CovidMapper\n![Android CI](https://github.com/rishabh115/CovidMapper/workflows/Android%20CI/badge.svg?branch=master)\n\nA minimal library for getting Covid-19 data of all the countries fetched from [worldmeters.info](https://www.worldometers.info/coronavirus/). \n\n\u003cimg src=\"https://github.com/rishabh115/CovidMapper/blob/master/screenshots/Screenshot_1585083277.png\" width=\"200\" height=\"400\"\u003e\n\n## Instructions\n\n_Follow these instructions to integrate covidmapper library in your project_\n\n1. Open your project in Android Studio\n2. Download the library (using Git, or a zip archive to unzip).\n3. Copy and paste the covidmapper folder to your project top-level directory.\n4. Make sure the library is listed at the top of your settings.gradle file by adding the following line\n    ```\n    include ':app'\n    include ':covidmapper'\n    ```\n5. Open the app module's build.gradle file and add a new line to the dependencies block as shown in the following snippet:\n   ```\n    dependencies {\n      implementation project(path: ':covidmapper')\n    }\n   ```\n6. Add Internet permission in the `AndroidManifest.xml`.    \n7. Click \u003cb\u003eSync Project with Gradle Files\u003c/b\u003e.   \n\n## Usage\n\n `DataParser` is the main class responsible for making the request, parsing the data and passing it down to the listener under the hood. So, you don't have write any such networking and parsing logic by yourself. To get the data in any component, just implement `DataListener` interface and call `DataParser(this).getCountriesData()` as soon as the views are ready.\n \n Here is a simple example of using this library:\n ```kotlin\n    import androidx.appcompat.app.AppCompatActivity\n    import android.os.Bundle\n    import android.view.View\n    import android.widget.ProgressBar\n    import android.widget.Toast\n    import androidx.recyclerview.widget.LinearLayoutManager\n    import androidx.recyclerview.widget.RecyclerView\n\n    class MainActivity : AppCompatActivity(), DataListener {\n\n        private lateinit var someAdapter: SomeAdapter\n        private lateinit var progress: ProgressBar\n\n        override fun onCreate(savedInstanceState: Bundle?) {\n            super.onCreate(savedInstanceState)\n            setContentView(R.layout.activity_main)\n            val someList = findViewById\u003cRecyclerView\u003e(R.id.rv_main)\n            progress = findViewById(R.id.progress)\n            someAdapter = SomeAdapter()\n            someList.adapter = someAdapter\n            someList.layoutManager = LinearLayoutManager(this)\n            progress.visibility = View.VISIBLE\n            \n            // Just add this line and see the magic\n            DataParser(this).getCountriesData()\n        }\n\n        override fun onDataReceived(response: Response) {\n            when(response){\n                is Success -\u003e {\n                    progress.visibility = View.GONE\n                    someAdapter.setData(response.data)\n                }\n                is Failure -\u003e {\n                    progress.visibility = View.GONE\n                    Toast.makeText(applicationContext, \"Failed to fetch data!\", Toast.LENGTH_SHORT).show()\n                }\n            }.exhaustiveCall\n        }\n      }\n\n ```\n \n `CountryData.kt`\n \n ```kotlin\n    data class CountryData (val country: String, val totalCases: Int, val newCases: Int,\n                        val totalDeaths: Int, val newDeaths: Int, val totalRecovered: Int,\n                        val activeCases:Int, val criticalCases:Int)\n ```\n \n `Response` is a sealed class provided in the library for streamlined processing of Success or Failure situation at one place. When network request is successful, the listener is provided with a Success object that includes list of `CountryData`.\n \n ```kotlin\n    sealed class Response\n    class Success(val data: List\u003cCountryData\u003e):Response()\n    class Failure: Response()\n ```\n \n ### Contributions are welcome...\n \n ## Feel free to show your love :heart: by putting a star :star: on this project :v: .\n \n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabh115%2Fcovidmapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishabh115%2Fcovidmapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabh115%2Fcovidmapper/lists"}