目录

Situation

Class Info

public class Situation implements Parcelable

Current weather information. The information includes the weather ID, humidity, atmospheric temperature (Celsius and Fahrenheit), somatosensory temperature (Celsius and Fahrenheit), wind direction, wind level, wind speed, atmospheric pressure, UV intensity, and update time.

Public Method Summary

Qualifier and Type

Method Name

int

getWeatherId()

String

getHumidity()

long

getTemperatureC()

long

getTemperatureF()

long

getRealFeelC()

long

getRealFeelF()

String

getWindDir()

int

getWindLevel()

int

getWindSpeed()

long

getUpdateTime()

long

getPressure()

int

getUvIndex()

Public Method

[h2]getWeatherId

Method

public int getWeatherId()

Obtains the weather ID. Weather IDs vary with the current weather. For example, 1 indicates sunny, 7 indicates cloudy, and 18 indicates rain. For details about the weather specified by a weather ID, please refer to WeatherId.

Returns

Type

Description

int

Weather ID.

[h2]getHumidity

Method

public String getHumidity()

Obtains the humidity, in percentage.

Returns

Type

Description

String

Humidity, in percentage.

[h2]getTemperatureC

Method

public long getTemperatureC()

Obtains the current atmospheric temperature (Celsius).

Returns

Type

Description

long

Current atmospheric temperature (Celsius).

[h2]getTemperatureF

Method

public long getTemperatureF()

Obtains the current temperature (Fahrenheit).

Returns

Type

Description

long

Current temperature (Fahrenheit).

[h2]getRealFeelC

Method

public long getRealFeelC()

Obtains the somatosensory temperature (Celsius).

Returns

Type

Description

long

Somatosensory temperature (Celsius).

[h2]getRealFeelF

Method

public long getRealFeelF()

Obtains the somatosensory temperature (Fahrenheit).

Returns

Type

Description

long

Somatosensory temperature (Fahrenheit).

[h2]getWindDir

Method

public String getWindDir()

Obtains the wind direction. The options are NE (northeast), E (east), SE (southeast), S (south), SW (southwest), W (west), N (north), and NW (northwest).

Returns

Type

Description

String

Wind direction. The options are NE (northeast), E (east), SE (southeast), S (south), SW (southwest), W (west), N (north), and NW (northwest).

[h2]getWindLevel

Method

public int getWindLevel()

Obtains the wind level. The value ranges from 0 to 17. 0: no wind

Returns

Type

Description

int

Wind level. The value ranges from 0 to 17. 0: no wind

[h2]getWindSpeed

Method

public int getWindSpeed()

Obtains the wind speed (unit: km/h).

Returns

Type

Description

int

Wind speed (unit: km/h).

[h2]getUpdateTime

Method

public long getUpdateTime()

Obtains the release time of the weather broadcast.

Returns

Type

Description

long

Release timestamp of the weather broadcast.

[h2]getPressure

Method

public long getPressure()

Obtains the atmospheric pressure, in hPa.

Returns

Type

Description

long

Atmospheric pressure, in hPa.

[h2]getUvIndex

Method

public int getUvIndex()

Obtains the current UV intensity. For details about the UV light levels, please refer to WeatherStatus.

Returns

Type

Description

int

UV intensity.