Git Product home page Git Product logo

caravancodes / consumable-code-covid-19-api Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 179 KB

Retrofit has been Handled !! || Consumable code for request Public API (Covid-19 Api) For Coronavirus Tracker || :books: :bat:

Home Page: https://covid19api.com/

License: Apache License 2.0

Kotlin 100.00%
covid-19 covid-data covid19 covid19-data covid-api android-library retrofit2 library api android-api

consumable-code-covid-19-api's Introduction

ScreenShoot Apps

consumable-code-covid-19-api


Eliminates the method of retrieving json data using retrofit repeatedly. so this project has a set of functions to retrieve data without the need for fetching data using the retrofit of the API

Documentation Covid 19 Api

https://covid19api.com/

Version Release

This Is Latest Release

$version_release = 1.0.1

What's New??

* Adding Get Routes *

How To Use This Project

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        // library consumable code covid 19 api
        implementation 'com.github.amirisback:consumable-code-covid-19-api:1.0.1'
}

Step 3. Declaration ConsumeCovid19Api

val consumeCovid19Api = ConsumeCovid19Api()
consumeCovid19Api.usingChuckInterceptor(this) // This is Code Chuck Interceptor
consumeCovid19Api.getSummaryData(object : Covid19ResultCallback<ReponseSummary> {
    override fun getResultData(data: ReponseSummary) {
        // * PLACE YOUR CODE HERE FOR UI / ARRAYLIST *
    }

    override fun failedResult(statusCode: Int, errorMessage: String?) {
        // failed result
    }

    override fun onShowProgress() {
        // showing your progress view
    }

    override fun onHideProgress() {
        // hiding your progress view
    }
})

Function Main From This Project

// Switch For Using Chuck Interceptor
fun usingChuckInterceptor(context: Context)

// List Routes
// List all routes with parameters and descriptions.
fun getRoutes(callback: Covid19ResultCallback<List<Route>>)

// Get Summary Data
// Return new cases and total cases per country.
fun getSummaryData(callback: Covid19ResultCallback<ReponseSummary>)

// Get All Data
// This call returns ~8MB of data and currently takes around 5 seconds.
fun getAllData(callback: Covid19ResultCallback<List<Status>>)

// Get All Countries
// List all countries and their provinces.
fun getAllCountries(callback: Covid19ResultCallback<List<Country>>)

// Get Status By Country
// {country} must be the country_slug the API call above
// {status} must be one of: confirmed, deaths, recovered
fun getStatusByCountry(
    country: String,
    status: String,
    callback: Covid19ResultCallback<List<Status>>
)

// Get Status By Country And Province
// {country} must be the country_slug the API call above
// {status} must be one of: confirmed, deaths, recovered
fun getStatusByCountryProvince(
    country: String,
    status: String,
    callback: Covid19ResultCallback<List<Status>>
)

// Get Status By Country From First Recorded Case
// {country} must be the country_slug the API call above
// {status} must be one of: confirmed, deaths, recovered
fun getFirstRecordedByCountry(
    country: String,
    status: String,
    callback: Covid19ResultCallback<List<Status>>
)

// Get Status By Country And Province From First Recorded Case
// {country} must be the country_slug the API call above
// {status} must be one of: confirmed, deaths, recovered
fun getFirstRecordedByCountryProvince(
    country: String,
    status: String,
    callback: Covid19ResultCallback<List<Status>>
)

Colaborator

Very open to anyone, I'll write your name under this, please contribute by sending an email to me

  • Mail To [email protected]
  • Subject : Github _ [Github-Username-Account] _ [Language] _ [Repository-Name]
  • Example : Github_amirisback_kotlin_admob-helper-implementation

Name Of Contribute

  • Muhammad Faisal Amir
  • Waiting List
  • Waiting List

Waiting for your contribute

Attention !!!

Please enjoy and don't forget fork and give a star

  • Don't Forget Follow My Github Account
  • If you like this library, please help me / you can donate to buy patreon services

consumable-code-covid-19-api's People

Contributors

amirisback avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

akbaryjun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.