Android Open Source - Sunshine Weather Contract






From Project

Back to project page Sunshine.

License

The source code is released under:

GNU General Public License

If you think the Android project Sunshine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package la.sonny.sunshine.data;
/*  w  w  w.j ava2 s.c o  m*/
import android.provider.BaseColumns;

/**
 * Created by sonny on 10/12/14.
 */
public class WeatherContract {
    /* Defines the table contents of the weather table */
    public static final class WeatherEntry implements BaseColumns {

        public static final String TABLE_NAME = "weather";

        // Column with the foreign key into the location table.
        public static final String COLUMN_LOC_KEY = "location_id";

        // Date, stored as Text with format yyyy-MM-dd
        public static final String COLUMN_DATETEXT = "date";

        // Weather id as returned by API, to identify the icon to be used
        public static final String COLUMN_WEATHER_ID = "weather_id";

        // Short description and long description of the weather, as provided by API.
        // e.g "clear" vs "sky is clear".
        public static final String COLUMN_SHORT_DESC = "short_desc";

        // Min and max temperatures for the day (stored as floats)
        public static final String COLUMN_MIN_TEMP = "min";
        public static final String COLUMN_MAX_TEMP = "max";

        // Humidity is stored as a float representing percentage
        public static final String COLUMN_HUMIDITY = "humidity";

        // Humidity is stored as a float representing percentage
        public static final String COLUMN_PRESSURE = "pressure";

        // Windspeed is stored as a float representing windspeed mph
        public static final String COLUMN_WIND_SPEED = "wind";

        // Degrees are meteorological degrees (e.g, 0 is north, 180 is south).  Stored as floats.
        public static final String COLUMN_DEGREES = "degrees";
    }

    /* Defines the table contents of the location table */
    public static final class LocationEntry implements BaseColumns {

        public static final String TABLE_NAME = "location";

        // Location Setting, which will be sent to openweathermap api as location query
        public static final String COLUMN_LOC_SETTING = "location_setting";

        // GPS coordinates which are returned by open weather map
        public static final String COLUMN_LAT = "latitude";
        public static final String COLUMN_LONG = "longitude";

        // City Name, sent as a string by openweathermap.
        public static final String COLUMN_CITY_NAME = "city_name";
    }
}




Java Source Code List

la.sonny.sunshine.ApplicationTest.java
la.sonny.sunshine.DetailActivity.java
la.sonny.sunshine.ForecastFragment.java
la.sonny.sunshine.MainActivity.java
la.sonny.sunshine.SettingsActivity.java
la.sonny.sunshine.data.WeatherContract.java
la.sonny.sunshine.data.WeatherDBHelper.java