1 package uk
.me
.njae
.sunshine
.data
;
3 import android
.provider
.BaseColumns
;
6 * Created by neil on 09/11/14.
8 public class WeatherContract
{
9 /* Inner class that defines the table contents of the location table */
10 public static final class LocationEntry
implements BaseColumns
{
13 public static final String TABLE_NAME
= "location";
15 // The location setting string is what will be sent to openweathermap
16 // as the location query.
17 public static final String COLUMN_LOCATION_SETTING
= "location_setting";
19 // Human readable location string, provided by the API. Because for styling,
20 // "Mountain View" is more recognizable than 94043.
21 public static final String COLUMN_CITY_NAME
= "city_name";
23 // In order to uniquely pinpoint the location on the map when we launch the
24 // map intent, we store the latitude and longitude as returned by openweathermap.
25 public static final String COLUMN_COORD_LAT
= "coord_lat";
26 public static final String COLUMN_COORD_LONG
= "coord_long";
29 /* Inner class that defines the table contents of the weather table */
30 public static final class WeatherEntry
implements BaseColumns
{
32 public static final String TABLE_NAME
= "weather";
34 // Column with the foreign key into the location table.
35 public static final String COLUMN_LOC_KEY
= "location_id";
36 // Date, stored as Text with format yyyy-MM-dd
37 public static final String COLUMN_DATETEXT
= "date";
38 // Weather id as returned by API, to identify the icon to be used
39 public static final String COLUMN_WEATHER_ID
= "weather_id";
41 // Short description and long description of the weather, as provided by API.
42 // e.g "clear" vs "sky is clear".
43 public static final String COLUMN_SHORT_DESC
= "short_desc";
45 // Min and max temperatures for the day (stored as floats)
46 public static final String COLUMN_MIN_TEMP
= "min";
47 public static final String COLUMN_MAX_TEMP
= "max";
49 // Humidity is stored as a float representing percentage
50 public static final String COLUMN_HUMIDITY
= "humidity";
52 // Humidity is stored as a float representing percentage
53 public static final String COLUMN_PRESSURE
= "pressure";
55 // Windspeed is stored as a float representing windspeed mph
56 public static final String COLUMN_WIND_SPEED
= "wind";
58 // Degrees are meteorological degrees (e.g, 0 is north, 180 is south). Stored as floats.
59 public static final String COLUMN_DEGREES
= "degrees";