| java.lang.Object | |
| ↳ | lineageos.weather.LineageWeatherManager |
Provides access to the weather services in the device.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| LineageWeatherManager.LookupCityRequestListener | Interface used to receive notifications upon completion of a request to lookup a city name | ||||||||||
| LineageWeatherManager.RequestStatus | The different request statuses | ||||||||||
| LineageWeatherManager.WeatherServiceProviderChangeListener | Interface used to be notified when the user changes the weather service provider | ||||||||||
| LineageWeatherManager.WeatherUpdateRequestListener | Interface used to receive notifications upon completion of a weather update request | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Cancels a request that was previously submitted to the weather service.
| |||||||||||
Gets the service's label as declared by the active weather service provider in its manifest
| |||||||||||
Gets or creates an instance of the
LineageWeatherManager
| |||||||||||
Request the active weather provider service to lookup the supplied city name.
| |||||||||||
Registers a
LineageWeatherManager.WeatherServiceProviderChangeListener to be notified when a new weather
service provider becomes active.
| |||||||||||
Forces the weather service to request the latest available weather information for
the supplied
Location location.
| |||||||||||
Forces the weather service to request the latest weather information for the provided
WeatherLocation.
| |||||||||||
Unregisters a listener
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||
Cancels a request that was previously submitted to the weather service.
| Parameters | |
|---|---|
requestId |
int: The ID that you received when the request was submitted
|
Gets the service's label as declared by the active weather service provider in its manifest
| Returns | |
|---|---|
String |
the service's label |
Gets or creates an instance of the LineageWeatherManager
| Returns | |
|---|---|
LineageWeatherManager |
LineageWeatherManager
|
Request the active weather provider service to lookup the supplied city name.
| Parameters | |
|---|---|
city |
String: The city name |
listener |
LineageWeatherManager.LookupCityRequestListener: LineageWeatherManager.LookupCityRequestListener To be notified once the request has been
completed. Upon success, a list of
WeatherLocation
will be provided |
| Returns | |
|---|---|
int |
An integer that identifies the request submitted to the weather service. Note that this method might return -1 if an error occurred while trying to submit the request. |
Registers a LineageWeatherManager.WeatherServiceProviderChangeListener to be notified when a new weather
service provider becomes active.
| Parameters | |
|---|---|
listener |
LineageWeatherManager.WeatherServiceProviderChangeListener: LineageWeatherManager.WeatherServiceProviderChangeListener to register
|
Forces the weather service to request the latest available weather information for
the supplied Location location.
| Parameters | |
|---|---|
location |
Location: The location you want to get the latest weather data from. |
listener |
LineageWeatherManager.WeatherUpdateRequestListener: LineageWeatherManager.WeatherUpdateRequestListener To be notified once the active weather
service provider has finished
processing your request |
| Returns | |
|---|---|
int |
An integer that identifies the request submitted to the weather service Note that this method might return -1 if an error occurred while trying to submit the request. |
Forces the weather service to request the latest weather information for the provided WeatherLocation. This is the preferred method for requesting a weather update.
| Parameters | |
|---|---|
weatherLocation |
WeatherLocation: A WeatherLocation that was previously
obtained by calling
lookupCity(String, LookupCityRequestListener) |
listener |
LineageWeatherManager.WeatherUpdateRequestListener: LineageWeatherManager.WeatherUpdateRequestListener To be notified once the active weather
service provider has finished
processing your request |
| Returns | |
|---|---|
int |
An integer that identifies the request submitted to the weather service. Note that this method might return -1 if an error occurred while trying to submit the request. |
Unregisters a listener
| Parameters | |
|---|---|
listener |
LineageWeatherManager.WeatherServiceProviderChangeListener: A previously registered LineageWeatherManager.WeatherServiceProviderChangeListener
|