1
/*
2
* Copyright 2013 The Android Open Source Project
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
package com.example.android.basicsyncadapter.provider;
18
19
import android.content.ContentResolver;
20
import android.net.Uri;
21
import android.provider.BaseColumns;
22
23
/**
24
* Field and table name constants for
25
* {@link com.example.android.basicsyncadapter.provider.FeedProvider}.
26
*/
27
public class FeedContract {
28
private FeedContract() {
29
}
30
31
/**
32
* Content provider authority.
33
*/
34
public static final String CONTENT_AUTHORITY = "com.example.android.basicsyncadapter";
35
36
/**
37
* Base URI. (content://com.example.android.basicsyncadapter)
38
*/
39
public static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY);
40
41
/**
42
* Path component for "entry"-type resources..
43
*/
44
private static final String PATH_ENTRIES = "entries";
45
46
/**
47
* Columns supported by "entries" records.
48
*/
49
public static class Entry implements BaseColumns {
50
/**
51
* MIME type for lists of entries.
52
*/
53
public static final String CONTENT_TYPE =
54
ContentResolver.CURSOR_DIR_BASE_TYPE + "/vnd.basicsyncadapter.entries";
55
/**
56
* MIME type for individual entries.
57
*/
58
public static final String CONTENT_ITEM_TYPE =
59
ContentResolver.CURSOR_ITEM_BASE_TYPE + "/vnd.basicsyncadapter.entry";
60
61
/**
62
* Fully qualified URI for "entry" resources.
63
*/
64
public static final Uri CONTENT_URI =
65
BASE_CONTENT_URI.buildUpon().appendPath(PATH_ENTRIES).build();
66
67
/**
68
* Table name where records are stored for "entry" resources.
69
*/
70
public static final String TABLE_NAME = "entry";
71
/**
72
* Atom ID. (Note: Not to be confused with the database primary key, which is _ID.
73
*/
74
public static final String COLUMN_NAME_ENTRY_ID = "entry_id";
75
/**
76
* Article title
77
*/
78
public static final String COLUMN_NAME_TITLE = "title";
79
/**
80
* Article hyperlink. Corresponds to the rel="alternate" link in the
81
* Atom spec.
82
*/
83
public static final String COLUMN_NAME_LINK = "link";
84
/**
85
* Date article was published.
86
*/
87
public static final String COLUMN_NAME_PUBLISHED = "published";
88
}
89
}