// Path: sthlmtraveling/src/main/java/com/markupartist/sthlmtraveling/provider/JourneysProvider.java
// public static final class Journeys implements BaseColumns {
//     public static final Uri CONTENT_URI =
//         Uri.parse("content://" + JourneysProvider.AUTHORITY + "/journeys");
//     public static final String CONTENT_TYPE =
//         "vnd.android.cursor.dir/vnd.sthlmtraveling.journeys";
//             
//     public static final int JOURNEY_ID_PATH_POSITION = 1;
// 
//     /**
//      * The default number of journeys to be saved in history.
//      * </p>
//      * Total number of journeys is history size + starred journeys.
//      */
//     public static final int DEFAULT_HISTORY_SIZE = 5;
// 
//     public static final String ID = "_id";
// 
//     /**
//      * The name, example "Take me home" or "To work".
//      */
//     public static final String NAME = "name";
// 
//     /**
//      * The position in a list.
//      */
//     public static final String POSITION = "position";
// 
//     /**
//      * If the journey is starred.
//      */
//     public static final String STARRED = "starred";
// 
//     /**
//      * When the entry was created.
//      */
//     public static final String CREATED_AT = "created_at";
// 
//     /**
//      * When the entry was updated.
//      */
//     public static final String UPDATED_AT = "updated_at";
// 
//     /**
//      * The journey data as json.
//      */
//     public static final String JOURNEY_DATA = "journey_data";
// 
//     /**
//      * The default sort order.
//      */
//     public static final String DEFAULT_SORT_ORDER =
//         "position DESC, updated_at DESC, created_at DESC";
// 
//     /**
//      * The history sort order, this also includes a limit.
//      */
//     public static final String HISTORY_SORT_ORDER =
//         "updated_at DESC, created_at DESC LIMIT " + DEFAULT_HISTORY_SIZE;
// 
// 
//     private Journeys() {
//     }
// }


import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.provider.BaseColumns;
import android.util.Log;
import com.markupartist.sthlmtraveling.BuildConfig;
import com.markupartist.sthlmtraveling.provider.JourneysProvider.Journey.Journeys;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
/*
 * Copyright (C) 2011 Johan Nilsson <http://markupartist.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.markupartist.sthlmtraveling.provider;




public class JourneysProvider extends ContentProvider {
    private static final String TAG = "JourneysProvider";

    private static final String DATABASE_NAME = "journeys.db";
    private static final int DATABASE_VERSION = 2;
    private static final String JOURNEYS_TABLE_NAME = "journeys";

    public static final String AUTHORITY = BuildConfig.BASE_PROVIDER_AUTHORITY + ".journeysprovider";

    /**
     * A UriMatcher instance
     */
    private static final UriMatcher sUriMatcher;

    /**
     * The incoming URI matches the Journeys URI pattern.
     */
    private static final int JOURNEYS = 1;

    /**
     * The incoming URI matches the Journey ID URI pattern
     */
    private static final int JOURNEY_ID = 2;

    /**
     * A projection map used to select columns from the database.
     */
    private static HashMap<String, String> sJourneysProjectionMap;

    private DatabaseHelper dbHelper;

    static {
        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
        sUriMatcher.addURI(AUTHORITY, "journeys", JOURNEYS);
        sUriMatcher.addURI(AUTHORITY, "journeys/#", JOURNEY_ID);

        sJourneysProjectionMap = new HashMap<String, String>();
// Path: sthlmtraveling/src/main/java/com/markupartist/sthlmtraveling/provider/JourneysProvider.java
// public static final class Journeys implements BaseColumns {
//     public static final Uri CONTENT_URI =
//         Uri.parse("content://" + JourneysProvider.AUTHORITY + "/journeys");
//     public static final String CONTENT_TYPE =
//         "vnd.android.cursor.dir/vnd.sthlmtraveling.journeys";
//             
//     public static final int JOURNEY_ID_PATH_POSITION = 1;
// 
//     /**
//      * The default number of journeys to be saved in history.
//      * </p>
//      * Total number of journeys is history size + starred journeys.
//      */
//     public static final int DEFAULT_HISTORY_SIZE = 5;
// 
//     public static final String ID = "_id";
// 
//     /**
//      * The name, example "Take me home" or "To work".
//      */
//     public static final String NAME = "name";
// 
//     /**
//      * The position in a list.
//      */
//     public static final String POSITION = "position";
// 
//     /**
//      * If the journey is starred.
//      */
//     public static final String STARRED = "starred";
// 
//     /**
//      * When the entry was created.
//      */
//     public static final String CREATED_AT = "created_at";
// 
//     /**
//      * When the entry was updated.
//      */
//     public static final String UPDATED_AT = "updated_at";
// 
//     /**
//      * The journey data as json.
//      */
//     public static final String JOURNEY_DATA = "journey_data";
// 
//     /**
//      * The default sort order.
//      */
//     public static final String DEFAULT_SORT_ORDER =
//         "position DESC, updated_at DESC, created_at DESC";
// 
//     /**
//      * The history sort order, this also includes a limit.
//      */
//     public static final String HISTORY_SORT_ORDER =
//         "updated_at DESC, created_at DESC LIMIT " + DEFAULT_HISTORY_SIZE;
// 
// 
//     private Journeys() {
//     }
// }


// Path: sthlmtraveling/src/main/java/com/markupartist/sthlmtraveling/provider/JourneysProvider.java
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.provider.BaseColumns;
import android.util.Log;
import com.markupartist.sthlmtraveling.BuildConfig;
import com.markupartist.sthlmtraveling.provider.JourneysProvider.Journey.Journeys;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;

/*
 * Copyright (C) 2011 Johan Nilsson <http://markupartist.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.markupartist.sthlmtraveling.provider;




public class JourneysProvider extends ContentProvider {
    private static final String TAG = "JourneysProvider";

    private static final String DATABASE_NAME = "journeys.db";
    private static final int DATABASE_VERSION = 2;
    private static final String JOURNEYS_TABLE_NAME = "journeys";

    public static final String AUTHORITY = BuildConfig.BASE_PROVIDER_AUTHORITY + ".journeysprovider";

    /**
     * A UriMatcher instance
     */
    private static final UriMatcher sUriMatcher;

    /**
     * The incoming URI matches the Journeys URI pattern.
     */
    private static final int JOURNEYS = 1;

    /**
     * The incoming URI matches the Journey ID URI pattern
     */
    private static final int JOURNEY_ID = 2;

    /**
     * A projection map used to select columns from the database.
     */
    private static HashMap<String, String> sJourneysProjectionMap;

    private DatabaseHelper dbHelper;

    static {
        sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
        sUriMatcher.addURI(AUTHORITY, "journeys", JOURNEYS);
        sUriMatcher.addURI(AUTHORITY, "journeys/#", JOURNEY_ID);

        sJourneysProjectionMap = new HashMap<String, String>();
        sJourneysProjectionMap.put(Journeys.ID, Journeys.ID);