Android Open Source - AndroidTrainingCode Data Provider Contract






From Project

Back to project page AndroidTrainingCode.

License

The source code is released under:

Apache License

If you think the Android project AndroidTrainingCode 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 com.example.android.threadsample;
/*from   ww  w  .  j  a  v a 2s.c  o m*/
import android.net.Uri;
import android.provider.BaseColumns;

/**
 *
 * Defines constants for accessing the content provider defined in DataProvider. A content provider
 * contract assists in accessing the provider's available content URIs, column names, MIME types,
 * and so forth, without having to know the actual values.
 */
public final class DataProviderContract implements BaseColumns {

    private DataProviderContract() { }
        
        // The URI scheme used for content URIs
        public static final String SCHEME = "content";

        // The provider's authority
        public static final String AUTHORITY = "com.example.android.threadsample";

        /**
         * The DataProvider content URI
         */
        public static final Uri CONTENT_URI = Uri.parse(SCHEME + "://" + AUTHORITY);

        /**
         *  The MIME type for a content URI that would return multiple rows
         *  <P>Type: TEXT</P>
         */
        public static final String MIME_TYPE_ROWS =
                "vnd.android.cursor.dir/vnd.com.example.android.threadsample";

        /**
         * The MIME type for a content URI that would return a single row
         *  <P>Type: TEXT</P>
         *
         */
        public static final String MIME_TYPE_SINGLE_ROW =
                "vnd.android.cursor.item/vnd.com.example.android.threadsample";

        /**
         * Picture table primary key column name
         */
        public static final String ROW_ID = BaseColumns._ID;
        
        /**
         * Picture table name
         */
        public static final String PICTUREURL_TABLE_NAME = "PictureUrlData";

        /**
         * Picture table content URI
         */
        public static final Uri PICTUREURL_TABLE_CONTENTURI =
                Uri.withAppendedPath(CONTENT_URI, PICTUREURL_TABLE_NAME);

        /**
         * Picture table thumbnail URL column name
         */
        public static final String IMAGE_THUMBURL_COLUMN = "ThumbUrl";
        
        /**
         * Picture table thumbnail filename column name
         */
        public static final String IMAGE_THUMBNAME_COLUMN = "ThumbUrlName";
        
        /**
         * Picture table full picture URL column name
         */
        public static final String IMAGE_URL_COLUMN = "ImageUrl";
        
        /**
         * Picture table full picture filename column name
         */
        public static final String IMAGE_PICTURENAME_COLUMN = "ImageName";
        
        /**
         * Modification date table name
         */
        public static final String DATE_TABLE_NAME = "DateMetadatData";

        /**
         * Content URI for modification date table
         */
        public static final Uri DATE_TABLE_CONTENTURI =
                Uri.withAppendedPath(CONTENT_URI, DATE_TABLE_NAME);

        /**
         * Modification date table date column name
         */
        public static final String DATA_DATE_COLUMN = "DownloadDate";
        
        // The content provider database name
        public static final String DATABASE_NAME = "PictureDataDB";

        // The starting version of the database
        public static final int DATABASE_VERSION = 1;
}




Java Source Code List

com.example.android.animationsdemo.ApplicationTest.java
com.example.android.animationsdemo.CardFlipActivity.java
com.example.android.animationsdemo.CrossfadeActivity.java
com.example.android.animationsdemo.LayoutChangesActivity.java
com.example.android.animationsdemo.MainActivity.java
com.example.android.animationsdemo.ScreenSlideActivity.java
com.example.android.animationsdemo.ScreenSlidePageFragment.java
com.example.android.animationsdemo.TouchHighlightImageButton.java
com.example.android.animationsdemo.ZoomActivity.java
com.example.android.lifecycle.ActivityA.java
com.example.android.lifecycle.ActivityB.java
com.example.android.lifecycle.ActivityC.java
com.example.android.lifecycle.ApplicationTest.java
com.example.android.lifecycle.DialogActivity.java
com.example.android.lifecycle.util.StatusTracker.java
com.example.android.lifecycle.util.Utils.java
com.example.android.threadsample.BroadcastNotifier.java
com.example.android.threadsample.Constants.java
com.example.android.threadsample.DataProviderContract.java
com.example.android.threadsample.DataProvider.java
com.example.android.threadsample.DisplayActivity.java
com.example.android.threadsample.PhotoDecodeRunnable.java
com.example.android.threadsample.PhotoDownloadRunnable.java
com.example.android.threadsample.PhotoFragment.java
com.example.android.threadsample.PhotoManager.java
com.example.android.threadsample.PhotoTask.java
com.example.android.threadsample.PhotoThumbnailFragment.java
com.example.android.threadsample.PhotoView.java
com.example.android.threadsample.ProgressNotifier.java
com.example.android.threadsample.RSSPullParser.java
com.example.android.threadsample.RSSPullService.java