Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.81 KB

README.md

File metadata and controls

57 lines (45 loc) · 1.81 KB

COVID-19 CORONAVIRUS OUTBREAK

Using this library you will find the following information about coronavirus-

  • Coronavirus Cases
  • Deaths
  • Recovered

Installation

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

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

Step 2. Add the dependency

dependencies {
	        implementation 'com.github.fsfaysalcse:AndroidCoronaApiLib:0.1.1'
	}

Usage

Corona.setTotalOutbreakListener(MainActivity.this,new TotalOutbreakListener() {
                @Override
                   public void success(Response response) {
                    Log.d(TAG, "success: "+response.getMessage());
                     if (response.isSuccess()){
                             List<ReportByCountry> list=response.getReportByCountry();
                             Log.d(TAG, "Coronavirus Cases : "+response.getOutbreak().getTotalCases());
                             Log.d(TAG,    "Deaths : "+response.getOutbreak().getTotalDeaths());
                             Log.d(TAG, "Recovered : "+response.getOutbreak().getTotalRecovered());
                             Log.d(TAG, "Report List by Country : "+list.get(0).toString());
                            dialog.dismiss();
                    }

                 @Override
                   public void failed(String errorMessage) {
                     Log.d(TAG, "failed: "+errorMessage);
                     dialog.dismiss();
              }
        });

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the tests as appropriate.