public class AnprContentEntry
extends java.lang.Object
implements android.provider.BaseColumns
ContentResolver
ContentResolver simpleResolver = getActivity().getContentResolver();
Cursor cursor = contentResolver.query(AnprContentEntry.RESULTS_URI,
new String[] {AnprContentEntry.COLUMN_NAME_PLATE, AnprContentEntry.COLUMN_NAME_CONFIDENCE},
"WHERE " + AnprContentEntry._ID + " = ?", new String[] {"101"}, null);
if (cursor != null) {
// Read cursor contents
...
cursor.close();
}
For more advanced technique please refer to ContentObserver
from android
documentationModifier and Type | Field and Description |
---|---|
static java.lang.String |
COLUMN_NAME_ANPR_PARAMS
Used params Column name.
|
static java.lang.String |
COLUMN_NAME_CONFIDENCE
Confidence Column name.
|
static java.lang.String |
COLUMN_NAME_COUNTRY
Country code column name.
|
static java.lang.String |
COLUMN_NAME_DATE
Date Column name.
|
static java.lang.String |
COLUMN_NAME_IMAGE
Image file Column name.
|
static java.lang.String |
COLUMN_NAME_LATI
Latitude Column name.
|
static java.lang.String |
COLUMN_NAME_LONGI
Longitude Column name.
|
static java.lang.String |
COLUMN_NAME_PLATE
License plate column name.
|
static java.lang.String |
COLUMN_NAME_PRIO
Priority column name.
|
static java.lang.String |
COLUMN_NAME_TIIMESTAMP
Timestamp Column name.
|
static java.lang.String |
DATE_FORMAT
Format used by content provider to store recognition date
|
static java.lang.String |
DB_NAME
Database name
|
static int |
DB_VERSION
Database version
|
protected java.lang.String |
mAnprParamsJson |
protected java.util.Date |
mCaptureTime |
protected float |
mConfidence |
protected java.lang.String |
mCountryCode |
protected java.io.File |
mImageFile |
protected double |
mLatitude |
protected double |
mLongitude |
protected java.lang.String |
mPlate |
protected android.net.Uri |
mUri |
static java.lang.String |
RESULTS_TABLE
Results table name
|
static android.net.Uri |
RESULTS_URI
Content provider URI
|
static java.lang.String |
TIME_STAMP_FORMAT
Format used by content provider to store recognition timestamp as string
|
Modifier | Constructor and Description |
---|---|
protected |
AnprContentEntry() |
|
AnprContentEntry(android.database.Cursor cursor)
Constructs ContentEntry based on queried db values.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAnprParamsJson() |
java.util.Date |
getCaptureTime() |
float |
getConfidence() |
android.net.Uri |
getContentUri() |
java.lang.String |
getCountryCode() |
java.io.File |
getImageFile() |
double |
getLatitude() |
double |
getLongitude() |
java.lang.String |
getPlate() |
public static final java.lang.String DB_NAME
public static final int DB_VERSION
public static final java.lang.String TIME_STAMP_FORMAT
public static final java.lang.String DATE_FORMAT
public static final java.lang.String RESULTS_TABLE
public static final java.lang.String COLUMN_NAME_PLATE
public static final java.lang.String COLUMN_NAME_PRIO
public static final java.lang.String COLUMN_NAME_COUNTRY
public static final java.lang.String COLUMN_NAME_IMAGE
public static final java.lang.String COLUMN_NAME_TIIMESTAMP
TIME_STAMP_FORMAT
.public static final java.lang.String COLUMN_NAME_LATI
public static final java.lang.String COLUMN_NAME_LONGI
public static final java.lang.String COLUMN_NAME_DATE
DATE_FORMAT
.public static final java.lang.String COLUMN_NAME_CONFIDENCE
public static final java.lang.String COLUMN_NAME_ANPR_PARAMS
public static final android.net.Uri RESULTS_URI
protected android.net.Uri mUri
protected java.lang.String mPlate
protected java.lang.String mCountryCode
protected java.io.File mImageFile
protected java.util.Date mCaptureTime
protected double mLatitude
protected double mLongitude
protected float mConfidence
protected java.lang.String mAnprParamsJson
public AnprContentEntry(android.database.Cursor cursor)
String[] colunsToReturn = new String[]{
AnprContentEntry._ID, AnprContentEntry.COLUMN_NAME_TIIMESTAMP,
AnprContentEntry.COLUMN_NAME_IMAGE, AnprContentEntry.COLUMN_NAME_PLATE,
AnprContentEntry.COLUMN_NAME_COUNTRY, AnprContentEntry.COLUMN_NAME_LATI,
AnprContentEntry.COLUMN_NAME_LONGI, AnprContentEntry.COLUMN_NAME_CONFIDENCE,
AnprContentEntry.COLUMN_NAME_ANPR_PARAMS
};
ContentResolver contentResolver = getContentResolver();
Cursor resCursor = contentResolver.query(AnprContentEntry.RESULTS_URI, colunsToReturn,
whereClause, null, null);
ArrayList<AnprContentEntry> contentEntries = new ArrayList<>();
while(resCursor.moveToNext()) {
AnprContentEntry contentEntry = new AnprContentEntry(resCursor);
contentEntries.add(contentEntry);
}
cursor
- db cursorprotected AnprContentEntry()
public java.io.File getImageFile()
public java.lang.String getPlate()
public android.net.Uri getContentUri()
public java.lang.String getCountryCode()
public java.util.Date getCaptureTime()
public double getLatitude()
public double getLongitude()
public float getConfidence()
public java.lang.String getAnprParamsJson()