TrackerProviderpublic class TrackerProvider extends android.content.ContentProvider Content provider for location tracking.
It is recommended to use the TrackerDataHelper class to access this data
rather than this class directly |
Fields Summary |
---|
public static final android.net.Uri | CONTENT_URI | private static final String | DB_NAME | private static final String | TABLE_NAME | private static final int | DB_VERSION | private static final String | LOG_TAG | private DatabaseHelper | mOpenHelper |
Methods Summary |
---|
public int | delete(android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int result = db.delete(TABLE_NAME, selection, selectionArgs);
getContext().getContentResolver().notifyChange(uri, null);
return result;
| public java.lang.String | getType(android.net.Uri uri)
throw new UnsupportedOperationException();
| public android.net.Uri | insert(android.net.Uri uri, android.content.ContentValues values)
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
long rowId = db.insert(TABLE_NAME, null, values);
if (rowId > 0) {
Uri addedUri = ContentUris.withAppendedId(CONTENT_URI, rowId);
getContext().getContentResolver().notifyChange(addedUri, null);
return addedUri;
}
return null;
| public boolean | onCreate()
mOpenHelper = new DatabaseHelper(getContext());
return true;
| public android.database.Cursor | query(android.net.Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
// TODO: extract limit from URI ?
Cursor cursor = db.query(TABLE_NAME, projection, selection,
selectionArgs, null, null, sortOrder);
getContext().getContentResolver().notifyChange(uri, null);
return cursor;
| public int | update(android.net.Uri uri, android.content.ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)
throw new UnsupportedOperationException();
|
|