public class TripContentProvider
extends android.content.ContentProvider
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TMD_TRIP_ITEM_MIME_TYPE
MIME type for tmd stats item
|
static java.lang.String |
TMD_TRIP_LIST_MIME_TYPE
MIME type for tmd stats list
|
Constructor and Description |
---|
TripContentProvider() |
Modifier and Type | Method and Description |
---|---|
void |
attachInfo(android.content.Context context,
android.content.pm.ProviderInfo info)
This function is used to initialise the URI matcher
|
int |
delete(android.net.Uri uri,
java.lang.String selection,
java.lang.String[] selectionArgs) |
static java.lang.String |
getAuthority(android.content.Context context)
Returns the authority string for this content provider
|
static android.net.Uri |
getTripUri(android.content.Context context)
Returns the URI to retrieve TMD Trip data from the provider
|
static android.net.Uri |
getTripUri(android.content.Context context,
long id)
Returns the URI to retrieve TMD Trip data from the provider
|
java.lang.String |
getType(android.net.Uri uri)
Returns the MIME type for a specific URI
TODO add the other URIs
|
android.net.Uri |
insert(android.net.Uri uri,
android.content.ContentValues values) |
boolean |
onCreate() |
android.database.Cursor |
query(android.net.Uri uri,
java.lang.String[] projection,
java.lang.String selection,
java.lang.String[] selectionArgs,
java.lang.String sortOrder) |
void |
shutdown() |
int |
update(android.net.Uri uri,
android.content.ContentValues values,
java.lang.String selection,
java.lang.String[] selectionArgs) |
applyBatch, applyBatch, bulkInsert, call, call, canonicalize, clearCallingIdentity, dump, getCallingPackage, getContext, getPathPermissions, getReadPermission, getStreamTypes, getWritePermission, isTemporary, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, restoreCallingIdentity, setPathPermissions, setReadPermission, setWritePermission, uncanonicalize
public static final java.lang.String TMD_TRIP_LIST_MIME_TYPE
public static final java.lang.String TMD_TRIP_ITEM_MIME_TYPE
public static java.lang.String getAuthority(@NonNull android.content.Context context)
context
- the context where the provider are being usedpublic static android.net.Uri getTripUri(@NonNull android.content.Context context)
context
- the context where the provider are being usedpublic static android.net.Uri getTripUri(@NonNull android.content.Context context, long id)
context
- the context where the provider are being usedpublic void attachInfo(android.content.Context context, android.content.pm.ProviderInfo info)
attachInfo
in class android.content.ContentProvider
context
- the contextinfo
- the provider infopublic java.lang.String getType(@NonNull android.net.Uri uri)
getType
in class android.content.ContentProvider
uri
- the URIpublic boolean onCreate()
onCreate
in class android.content.ContentProvider
public void shutdown()
shutdown
in class android.content.ContentProvider
@Nullable public android.database.Cursor query(@NonNull android.net.Uri uri, @Nullable java.lang.String[] projection, @Nullable java.lang.String selection, @Nullable java.lang.String[] selectionArgs, @Nullable java.lang.String sortOrder)
query
in class android.content.ContentProvider
@Nullable public android.net.Uri insert(@NonNull android.net.Uri uri, @Nullable android.content.ContentValues values)
insert
in class android.content.ContentProvider
public int delete(@NonNull android.net.Uri uri, @Nullable java.lang.String selection, @Nullable java.lang.String[] selectionArgs)
delete
in class android.content.ContentProvider
public int update(@NonNull android.net.Uri uri, @Nullable android.content.ContentValues values, @Nullable java.lang.String selection, @Nullable java.lang.String[] selectionArgs)
update
in class android.content.ContentProvider