|
WIMM Labs |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wimm.framework.provider.Weather
public final class Weather
This class exposes constants and methods for accessing weather forecast data in the WIMM Weather App. These data will be updated everytime the device sync with the WIMM server. Up to 7 days of weather forecast data will be available.
See Android Content Providers Dev Guide for more information on using
ContentProvider
.
Nested Class Summary | |
---|---|
static interface |
Weather.Columns
Columns for the Weather table. |
static class |
Weather.WeatherInfo
This class represents a single day of weather information for a specific city. |
Field Summary | |
---|---|
static String |
AUTHORITY
The authority. |
static String |
CONTENT_AUTHORITY
The content:// style URL for this provider. |
static Uri |
CONTENT_URI
The content:// style URL for this provider. |
static String |
DEFAULT_SORT_ORDER
The default sort order for this table. |
Constructor Summary | |
---|---|
Weather()
|
Method Summary | |
---|---|
static List<String> |
getCityTokens(ContentResolver cr)
Return An ArrayList CITY_UID for all the cities that
the user has added in the Weather App web preference settings. |
static Weather.WeatherInfo |
getFirstCityWeatherForToday(ContentResolver cr)
Convenience method for retrieving weather for the current day for the user's home city. |
static Weather.WeatherInfo[] |
getWeatherForCity(ContentResolver cr,
String cityUid)
Retrieves all available weather data for the city matching cityUid . |
static Weather.WeatherInfo |
getWeatherInfoFromCursor(Cursor c)
Retrieves a Weather.WeatherInfo object from a Cursor at the current row. |
static Cursor |
query(ContentResolver cr,
String[] projection)
Use this method to query for a Cursor that points to all the Weather data
in the Weather App database. |
static Cursor |
query(ContentResolver cr,
String[] projection,
String where,
String[] whereArgs,
String orderBy)
Use this method to query with arguments for a Cursor that points to specific
Weather data in the Weather App database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String AUTHORITY
Constant Value: "com.wimm.weather"
public static final String CONTENT_AUTHORITY
public static final Uri CONTENT_URI
public static final String DEFAULT_SORT_ORDER
Constructor Detail |
---|
public Weather()
Method Detail |
---|
public static final Cursor query(ContentResolver cr, String[] projection)
Cursor
that points to all the Weather data
in the Weather App database.
Here's an example:
cr
- The ContentResolver
.projection
- The list of columns to put into the cursor. If null all columns are included.
Cursor
.public static final Cursor query(ContentResolver cr, String[] projection, String where, String[] whereArgs, String orderBy)
Cursor
that points to specific
Weather data in the Weather App database.
Here's an example that query for specifics Weather.Columns
of all the Weather data for
Los Altos city.
cr
- The ContentResolver
.projection
- The list of columns to put into the cursor. If null all columns are included.where
- The filter to apply.whereArgs
- The filter arguments.orderBy
- How to sort the cursor rows. If null the provider defines the sort order.
Cursor
.public static final Weather.WeatherInfo getWeatherInfoFromCursor(Cursor c)
Weather.WeatherInfo
object from a Cursor
at the current row.
Returns null if no more rows exist.
See query(android.content.ContentResolver, java.lang.String[])
sample code for usage example.
c
- The Cursor
.
Weather.WeatherInfo
.public static final List<String> getCityTokens(ContentResolver cr)
CITY_UID
for all the cities that
the user has added in the Weather App web preference settings.
Returns null if no cities were found.
cr
- The ContentResolver
.
public static final Weather.WeatherInfo[] getWeatherForCity(ContentResolver cr, String cityUid)
cityUid
.
Up to 7 days of weather data can be retrieved.
Returns null if no data was found.
cr
- The ContentResolver
.cityUid
- The city UID.
Weather.WeatherInfo
.public static final Weather.WeatherInfo getFirstCityWeatherForToday(ContentResolver cr)
If the user has configured the Weather application to NOT show a specified home city, then the first city in the Weather application list will be used instead.
Returns null if no data was found.
cr
- The ContentResolver
.
Weather.WeatherInfo
.
|
WIMM Labs |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |