Skip to content

Commit b974856

Browse files
authored
Update README.md
1 parent b2a408c commit b974856

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,22 @@ weatherMap.getCityWeather(city, new WeatherCallback() {
3737
public void success(WeatherResponseModel response) {
3838
Weather weather[] = response.getWeather();
3939
String weatherMain = weather[0].getMain();
40-
Double temperature = TempUnitConverter.convertToCelsius(response.getMain().getTemp());
41-
String location = response.getName();
42-
43-
String humidity= response.getMain().getHumidity();
44-
String pressure = response.getMain().getPressure();
45-
String windSpeed = response.getWind().getSpeed();
46-
47-
String iconLink = weather[0].getIconLink();
4840
}
4941
```
42+
To get temperature in specific units you can use:
43+
```Java
44+
Double temperature = TempUnitConverter.convertToCelsius(response.getMain().getTemp());
45+
```
46+
47+
To get other details you can use:
48+
```Java
49+
Double temperature = TempUnitConverter.convertToCelsius(response.getMain().getTemp());
50+
String location = response.getName();
51+
String humidity= response.getMain().getHumidity();
52+
String pressure = response.getMain().getPressure();
53+
String windSpeed = response.getWind().getSpeed();
54+
String iconLink = weather[0].getIconLink();
55+
```
5056
**By Location Coordinates**:
5157
```Java
5258
weatherMap.getLocationWeather(latitude, longitude, new WeatherCallback() {

0 commit comments

Comments
 (0)