In keeping with the idioms established by the Android platform, the Moseycode application uses content providers to expose data to other applications.
There is currently one data set exposed in this way: a history of the barcodes that have been scanned by the user. In the Moseycode parlance these are called portals.
The content provider for portals has the following Uri:
content://com.tomgibara.provider.moseycode/portalsEach row returned contains information about a portal that a user has
previously scanned. In keeping with what is understood to be the standard
approach, each row in the data set is uniquely identified by an opaque
long identifier. The Uri for an individual
portal matches the pattern:
content://com.tomgibara.provider.moseycode/portals/#It is intended that future versions of the Moseycode application will support
a larger number of Uri patterns.
The following columns can be associated with each portal instance:
_id Type: INTEGER (long)chamberid Type: INTEGER (int)shortdata Type: INTEGER (short)intdata Type: INTEGER (int)string Type: TEXT (String of space-separated tokens)format Type: TEXT (String)title Type: TEXT (String)author Type: TEXT (String)firstseen Type: INTEGER (long)lastseen Type: INTEGER (long)lastlat Type: REAL (double)lastlon Type: REAL (double)lastele Type: REAL (double)encounters Type: INTEGER (int)previewstate Type: TEXT (String)The Moseycode application generally records a preview image for each barcode it encounters. The quality and nature of this image is highly variable and should not be relied on to provide a consistent thematic appearance. Nevertheless, in most cases it provides a meaningful representation of some aspect of the barcode data.
The preview for a barcode is easily accessed by opening the portal's
associated Uri using the openInputStream method
on the context's ContentResolver. The returned InputStream
will contain an image using a platform supported encoding (typically PNG), or
will be null if no preview image is available for the portal. An example of how
to access and display preview images is available in the source code for the
Moseycode Harness application.
The default ordering when requesting a set of portals is
lastseen DESC; the last date on which the portal was seen,
most recent first. This reflects the predominant use of the this data set:
providing a barcode history.
chamberId,
shortData and intData fields.