/*
* Copyright (C) 2016 The Android Open Source Project
*
* 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.example.android.todolist.data;

import android.provider.BaseColumns;


public class TaskContract {

    /* TODO (1) Add content provider constants to the Contract
     Clients need to know how to access the task data, and it's your job to provide
     these content URI's for the path to that data:
        1) Content authority,
        2) Base content URI,
        3) Path(s) to the tasks directory
        4) Content URI for data in the TaskEntry class
      */


    /* TaskEntry is an inner class that defines the contents of the task table */
    public static final class TaskEntry implements BaseColumns {


        // Task table and column names
        public static final String TABLE_NAME = "tasks";

        // Since TaskEntry implements the interface "BaseColumns", it has an automatically produced
        // "_ID" column in addition to the two below
        public static final String COLUMN_DESCRIPTION = "description";
        public static final String COLUMN_PRIORITY = "priority";


        /*
        The above table structure looks something like the sample table below.
        With the name of the table and columns on top, and potential contents in rows

        Note: Because this implements BaseColumns, the _id column is generated automatically

        tasks
         - - - - - - - - - - - - - - - - - - - - - -
        | _id  |    description     |    priority   |
         - - - - - - - - - - - - - - - - - - - - - -
        |  1   |  Complete lesson   |       1       |
         - - - - - - - - - - - - - - - - - - - - - -
        |  2   |    Go shopping     |       3       |
         - - - - - - - - - - - - - - - - - - - - - -
        .
        .
        .
         - - - - - - - - - - - - - - - - - - - - - -
        | 43   |   Learn guitar     |       2       |
         - - - - - - - - - - - - - - - - - - - - - -

         */

    }
}

@@ -644,16 +644,40 @@
 .data;%0A%0A
+import android.net.Uri;%0A
 import a
@@ -705,16 +705,16 @@
 olumns;%0A
-
 %0A%0Apublic
@@ -1100,16 +1100,230 @@
      */%0A
+    public static final String AUTHORITY = %22com.example.android.todolist%22;%0A%0A    public static final Uri BASE_CONTENT_URI = Uri.parse(%22content://%22 + AUTHORITY);%0A%0A    public static final String PATH_TASKS = %22tasks%22;%0A
 %0A%0A    /*
@@ -1464,16 +1464,139 @@
 umns %7B%0A%0A
+        public static final Uri CONTENT_URI =%0A                BASE_CONTENT_URI.buildUpon().appendPath(PATH_TASKS).build();%0A
 %0A       

Complete TODOs for T09.02 AddURIsToContract exercise