Open Weather Api

Open Weather API Wrapper is an Android wrapper for the APIs of Open Weather Map. This library handles all the network operations and parameter validations on behalf of the developer.

Dependency:

	
dependencies {
    compile 'com.kevalpatel2106:open-weather-wrapper:1.0'
}

How to use this library?:

Initialization:

	
   	OpenWeatherApi.initialize("YOUR API KEY", Unit.STANDARD);
	

Accessing the API:

Open weather api provides you functions to access below information:

You can get the required information by passing the required parameters. The information will be received in specific listeners.

Here is the example of getting the three hourly forecast of the weather by city name.

	
	OpenWeatherApi.getThreeHoursForecast("Landon,uk", new ForecastListener() {
    	@Override
    	public void onResponse(WeatherForecast weatherForecasts) {
        	//Forecast received.
        	//Do someting
    	}

    	@Override
    	public void onError(String message) {
        	//Something went wrong.
        	//Display the error message to the user.
    	}
	});
	

Open Weather API Wrapper uses RxJava and Retrofit to handle the network operations.

Demo:


Srource Code: