Methods Summary |
---|
public void | deleteAll()Deletes all tracker entries
mContext.getContentResolver().delete(TrackerProvider.CONTENT_URI, null,
null);
|
public java.lang.String | getNextOutput(android.database.Cursor cursor)Helper method which converts row referenced by given cursor to a string
output
if (cursor == null || cursor.isAfterLast()) {
return null;
}
String output = mFormatter.getOutput(TrackerEntry.createEntry(cursor));
cursor.moveToNext();
return output;
|
public java.lang.String | getOutputFooter()Returns the output footer particular to the associated formatter
return mFormatter.getFooter();
|
public java.lang.String | getOutputHeader()Returns the output header particular to the associated formatter
return mFormatter.getHeader();
|
public android.database.Cursor | query(java.lang.String tag, int limit)Query tracker data, filtering by given tag
String selection = (tag == null ? null : TrackerEntry.TAG + "=?");
String[] selectionArgs = (tag == null ? null : new String[] {tag});
Cursor cursor = mContext.getContentResolver().query(
TrackerProvider.CONTENT_URI, TrackerEntry.ATTRIBUTES,
selection, selectionArgs, null);
if (cursor == null) {
return cursor;
}
int pos = (cursor.getCount() < limit ? 0 : cursor.getCount() - limit);
cursor.moveToPosition(pos);
return cursor;
|
public android.database.Cursor | query(int limit)Retrieves a cursor that starts at the last limit rows
return query(null, limit);
|
public android.database.Cursor | query(java.lang.String tag)Query tracker data, filtering by given tag. mo limit to number of rows
returned
return query(tag, Integer.MAX_VALUE);
|
void | writeEntry(TrackerEntry entry)insert given TrackerEntry into content provider
mContext.getContentResolver().insert(TrackerProvider.CONTENT_URI,
entry.getAsContentValues());
|
public void | writeEntry(android.location.Location loc, float distFromNetLoc)insert given location into tracker data
writeEntry(TrackerEntry.createEntry(loc, distFromNetLoc));
|
public void | writeEntry(java.lang.String tag, java.lang.String logMsg)insert given log message into tracker data
writeEntry(TrackerEntry.createEntry(tag, logMsg));
|