Skip to content

Commit

Permalink
Minor Update
Browse files Browse the repository at this point in the history
  • Loading branch information
KwabenBerko committed Nov 10, 2020
1 parent bb6b8ad commit e5845cb
Showing 1 changed file with 8 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,15 @@ protected void onCreate(Bundle savedInstanceState) {
*/


// helper.getCurrentWeatherByCityName("Accra", new CurrentWeatherCallback() {
// @Override
// public void onSuccess(CurrentWeather currentWeather) {
// Log.v(TAG,
// "Coordinates: " + currentWeather.getCoord().getLat() + ", "+currentWeather.getCoord().getLon() +"\n"
// +"Weather Description: " + currentWeather.getWeather().get(0).getDescription() + "\n"
// +"Temperature: " + currentWeather.getMain().getTempMax()+"\n"
// +"Wind Speed: " + currentWeather.getWind().getSpeed() + "\n"
// +"City, Country: " + currentWeather.getName() + ", " + currentWeather.getSys().getCountry()
// );
// }
//
// @Override
// public void onFailure(Throwable throwable) {
// Log.v(TAG, throwable.getMessage());
// }
// });


helper.getThreeHourForecastByCityName("Ontario, CA", new ThreeHourForecastCallback() {
helper.getCurrentWeatherByCityName("Accra", new CurrentWeatherCallback() {
@Override
public void onSuccess(ThreeHourForecast threeHourForecast) {
Log.v(TAG, "City/Country: "+ threeHourForecast.getCity().getName() + "/" + threeHourForecast.getCity().getCountry() +"\n"
+"Forecast Array Count: " + threeHourForecast.getCnt() +"\n"
//For this example, we are logging details of only the first forecast object in the forecasts array
+"First Forecast Date Timestamp: " + threeHourForecast.getList().get(0).getDt() +"\n"
+"First Forecast Weather Description: " + threeHourForecast.getList().get(0).getWeather().get(0).getDescription()+ "\n"
+"First Forecast Max Temperature: " + threeHourForecast.getList().get(0).getMain().getTempMax()+"\n"
+"First Forecast Wind Speed: " + threeHourForecast.getList().get(0).getWind().getSpeed() + "\n"
public void onSuccess(CurrentWeather currentWeather) {
Log.v(TAG,
"Coordinates: " + currentWeather.getCoord().getLat() + ", "+currentWeather.getCoord().getLon() +"\n"
+"Weather Description: " + currentWeather.getWeather().get(0).getDescription() + "\n"
+"Temperature: " + currentWeather.getMain().getTempMax()+"\n"
+"Wind Speed: " + currentWeather.getWind().getSpeed() + "\n"
+"City, Country: " + currentWeather.getName() + ", " + currentWeather.getSys().getCountry()
);
}

Expand Down

2 comments on commit e5845cb

@mehdilovve09
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello please update this

@KwabenBerko
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mehdilovve09, thanks.
Kindly note that the current branch and version is in alpha and its not fully ready yet.
The sample code will be reverted back to what we currently have in the README.md once I'm ready to move from alpha.
That's why I commented it out. 😊

Please sign in to comment.