@@ -0,0 +1,3187 @@
+/*%0A * Copyright (C) 2014 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.example.android.sunshine.app.data;%0A%0Aimport android.provider.BaseColumns;%0Aimport android.text.format.Time;%0A%0A/**%0A * Defines table and column names for the weather database.%0A */%0Apublic class WeatherContract %7B%0A%0A    // To make it easy to query for the exact date, we normalize all dates that go into%0A    // the database to the start of the the Julian day at UTC.%0A    public static long normalizeDate(long startDate) %7B%0A        // normalize the start date to the beginning of the (UTC) day%0A        Time time = new Time();%0A        time.set(startDate);%0A        int julianDay = Time.getJulianDay(startDate, time.gmtoff);%0A        return time.setJulianDay(julianDay);%0A    %7D%0A%0A    /*%0A        Inner class that defines the table contents of the location table%0A        Students: This is where you will add the strings.  (Similar to what has been%0A        done for WeatherEntry)%0A     */%0A    public static final class LocationEntry implements BaseColumns %7B%0A        public static final String TABLE_NAME = %22location%22;%0A%0A    %7D%0A%0A    /* Inner class that defines the table contents of the weather table */%0A    public static final class WeatherEntry implements BaseColumns %7B%0A%0A        public static final String TABLE_NAME = %22weather%22;%0A%0A        // Column with the foreign key into the location table.%0A        public static final String COLUMN_LOC_KEY = %22location_id%22;%0A        // Date, stored as long in milliseconds since the epoch%0A        public static final String COLUMN_DATE = %22date%22;%0A        // Weather id as returned by API, to identify the icon to be used%0A        public static final String COLUMN_WEATHER_ID = %22weather_id%22;%0A%0A        // Short description and long description of the weather, as provided by API.%0A        // e.g %22clear%22 vs %22sky is clear%22.%0A        public static final String COLUMN_SHORT_DESC = %22short_desc%22;%0A%0A        // Min and max temperatures for the day (stored as floats)%0A        public static final String COLUMN_MIN_TEMP = %22min%22;%0A        public static final String COLUMN_MAX_TEMP = %22max%22;%0A%0A        // Humidity is stored as a float representing percentage%0A        public static final String COLUMN_HUMIDITY = %22humidity%22;%0A%0A        // Humidity is stored as a float representing percentage%0A        public static final String COLUMN_PRESSURE = %22pressure%22;%0A%0A        // Windspeed is stored as a float representing windspeed  mph%0A        public static final String COLUMN_WIND_SPEED = %22wind%22;%0A%0A        // Degrees are meteorological degrees (e.g, 0 is north, 180 is south).  Stored as floats.%0A        public static final String COLUMN_DEGREES = %22degrees%22;%0A    %7D%0A%7D

Add WeatherContract