Home | History | Annotate | Download | only in threadsample
      1 package com.example.android.threadsample;
      2 
      3 import android.net.Uri;
      4 import android.provider.BaseColumns;
      5 
      6 /**
      7  *
      8  * Defines constants for accessing the content provider defined in DataProvider. A content provider
      9  * contract assists in accessing the provider's available content URIs, column names, MIME types,
     10  * and so forth, without having to know the actual values.
     11  */
     12 public final class DataProviderContract implements BaseColumns {
     13 
     14     private DataProviderContract() { }
     15 
     16         // The URI scheme used for content URIs
     17         public static final String SCHEME = "content";
     18 
     19         // The provider's authority
     20         public static final String AUTHORITY = "com.example.android.threadsample";
     21 
     22         /**
     23          * The DataProvider content URI
     24          */
     25         public static final Uri CONTENT_URI = Uri.parse(SCHEME + "://" + AUTHORITY);
     26 
     27         /**
     28          *  The MIME type for a content URI that would return multiple rows
     29          *  <P>Type: TEXT</P>
     30          */
     31         public static final String MIME_TYPE_ROWS =
     32                 "vnd.android.cursor.dir/vnd.com.example.android.threadsample";
     33 
     34         /**
     35          * The MIME type for a content URI that would return a single row
     36          *  <P>Type: TEXT</P>
     37          *
     38          */
     39         public static final String MIME_TYPE_SINGLE_ROW =
     40                 "vnd.android.cursor.item/vnd.com.example.android.threadsample";
     41 
     42         /**
     43          * Picture table primary key column name
     44          */
     45         public static final String ROW_ID = BaseColumns._ID;
     46 
     47         /**
     48          * Picture table name
     49          */
     50         public static final String PICTUREURL_TABLE_NAME = "PictureUrlData";
     51 
     52         /**
     53          * Picture table content URI
     54          */
     55         public static final Uri PICTUREURL_TABLE_CONTENTURI =
     56                 Uri.withAppendedPath(CONTENT_URI, PICTUREURL_TABLE_NAME);
     57 
     58         /**
     59          * Picture table thumbnail URL column name
     60          */
     61         public static final String IMAGE_THUMBURL_COLUMN = "ThumbUrl";
     62 
     63         /**
     64          * Picture table thumbnail filename column name
     65          */
     66         public static final String IMAGE_THUMBNAME_COLUMN = "ThumbUrlName";
     67 
     68         /**
     69          * Picture table full picture URL column name
     70          */
     71         public static final String IMAGE_URL_COLUMN = "ImageUrl";
     72 
     73         /**
     74          * Picture table full picture filename column name
     75          */
     76         public static final String IMAGE_PICTURENAME_COLUMN = "ImageName";
     77 
     78         /**
     79          * Modification date table name
     80          */
     81         public static final String DATE_TABLE_NAME = "DateMetadatData";
     82 
     83         /**
     84          * Content URI for modification date table
     85          */
     86         public static final Uri DATE_TABLE_CONTENTURI =
     87                 Uri.withAppendedPath(CONTENT_URI, DATE_TABLE_NAME);
     88 
     89         /**
     90          * Modification date table date column name
     91          */
     92         public static final String DATA_DATE_COLUMN = "DownloadDate";
     93 
     94         // The content provider database name
     95         public static final String DATABASE_NAME = "PictureDataDB";
     96 
     97         // The starting version of the database
     98         public static final int DATABASE_VERSION = 1;
     99 }
    100