Moseycode Content Providers

In keeping with the idioms established by the Android platform, the Moseycode application uses content providers to expose data to other applications.

Portals

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.

Content URIs

The content provider for portals has the following Uri:

content://com.tomgibara.provider.moseycode/portals

Each 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.

Columns

The following columns can be associated with each portal instance:

_id Type: INTEGER (long)
A unique identifer for the portal instance.
chamberid Type: INTEGER (int)
The chamberId of the portal.
shortdata Type: INTEGER (short)
The shortData of the portal.
intdata Type: INTEGER (int)
The intData of the portal.
string Type: TEXT (String of space-separated tokens)
A space separated list of flavor tokens.
type Type: TEXT (String)
The type of barcode scanned, at this time always Mosey.
title Type: TEXT (String)
A title supplied (or generated) for the barcode.
author Type: TEXT (String)
The name of the person who composed the definition of the barcode.
firstseen Type: INTEGER (long)
The time at which the barcode was first seen (in machine epoch time).
lastseen Type: INTEGER (long)
The time at which the barcode was last seen (in machine epoch time).
lastlat Type: REAL (double)
The latitude in degrees north.
lastlon Type: REAL (double)
The longitude in degrees east.
lastele Type: REAL (double)
The elevation in meters.
encounters Type: INTEGER (int)
The number of times the barcode is known to have been scanned.
previewstate Type: TEXT (String)
The state of the barcode when the last preview was generated.

Data

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.

Default Ordering

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.

Further Notes