Page Summary
-
This Weather interface is deprecated and will be turned off on January 31, 2020, with no alternate functionality offered by Google.
-
The interface provides methods to retrieve weather conditions, dew point, "feels like" temperature, humidity, and current temperature at the device's location.
-
Supported temperature units are Celsius and Fahrenheit.
-
Weather conditions are returned as an array of values representing different conditions like clear, cloudy, rainy, etc.
This interface is deprecated.
This method is deprecated as of August 07, 2019, and will be turned off on January 31, 2020.
Google does not offer alternate functionality for the Weather contextual signal.
Weather conditions at the device's current location.
Constant Summary
| int | CELSIUS | Celsius temperature unit. |
| int | CONDITION_CLEAR | Clear weather condition. |
| int | CONDITION_CLOUDY | Cloudy weather condition. |
| int | CONDITION_FOGGY | Foggy weather condition. |
| int | CONDITION_HAZY | Hazy weather condition. |
| int | CONDITION_ICY | Icy weather condition. |
| int | CONDITION_RAINY | Rainy weather condition. |
| int | CONDITION_SNOWY | Snowy weather condition. |
| int | CONDITION_STORMY | Stormy weather condition. |
| int | CONDITION_UNKNOWN | Unknown weather condition. |
| int | CONDITION_WINDY | Windy weather condition. |
| int | FAHRENHEIT | Fahrenheit temperature unit. |
Public Method Summary
| abstract int[] |
getConditions()
Returns the current weather conditions as an array of values that best describe
the current conditions.
|
| abstract float |
getDewPoint(int temperatureUnit)
Returns the dew point at the device's current location.
|
| abstract float |
getFeelsLikeTemperature(int temperatureUnit)
Returns what temperature a person would feel is at the device's current
location.
|
| abstract int |
getHumidity()
Returns the humidity level at the device's current location.
|
| abstract float |
getTemperature(int temperatureUnit)
Returns the current temperature at the device's current location.
|
Constants
public static final int CELSIUS
Celsius temperature unit.
public static final int CONDITION_CLEAR
Clear weather condition.
public static final int CONDITION_CLOUDY
Cloudy weather condition.
public static final int CONDITION_FOGGY
Foggy weather condition.
public static final int CONDITION_HAZY
Hazy weather condition.
public static final int CONDITION_ICY
Icy weather condition.
public static final int CONDITION_RAINY
Rainy weather condition.
public static final int CONDITION_SNOWY
Snowy weather condition.
public static final int CONDITION_STORMY
Stormy weather condition.
public static final int CONDITION_UNKNOWN
Unknown weather condition.
public static final int CONDITION_WINDY
Windy weather condition.
public static final int FAHRENHEIT
Fahrenheit temperature unit.
Public Methods
public abstract int[] getConditions ()
Returns the current weather conditions as an array of values that best describe the
current conditions. For example, rains with high winds will be represented as a
2-element int array with values
CONDITION_RAINY and
CONDITION_WINDY.
Returns
- The current weather conditions, each of which can take one of the following
values:
CONDITION_UNKNOWN,CONDITION_CLEAR,CONDITION_CLOUDY,CONDITION_FOGGY,CONDITION_HAZY,CONDITION_ICY,CONDITION_RAINY,CONDITION_SNOWY,CONDITION_STORMY, orCONDITION_WINDY.
public abstract float getDewPoint (int temperatureUnit)
Returns the dew point at the device's current location.
Parameters
| temperatureUnit | One of the supported temperature units:
FAHRENHEIT or CELSIUS. |
|---|
Returns
- The current dewpoint at the device's current location.
Throws
| IllegalArgumentException | An invalid value was passed for temperatureUnit. |
|---|
public abstract float getFeelsLikeTemperature (int temperatureUnit)
Returns what temperature a person would feel is at the device's current location.
Parameters
| temperatureUnit | One of the supported temperature units:
FAHRENHEIT or CELSIUS. |
|---|
Returns
- The current "feels-like" temperature at the device location.
Throws
| IllegalArgumentException | An invalid value was passed for temperatureUnit. |
|---|
public abstract int getHumidity ()
Returns the humidity level at the device's current location.
Returns
- The current humidity level in percentage (0 - 100%) at the device's current location.
public abstract float getTemperature (int temperatureUnit)
Returns the current temperature at the device's current location.
Parameters
| temperatureUnit | One of the supported temperature units:
FAHRENHEIT or CELSIUS. |
|---|
Returns
- The current temperature at the device location.
Throws
| IllegalArgumentException | An invalid value was passed for temperatureUnit. |
|---|