Skip to content
cketcham edited this page Jul 18, 2012 · 1 revision

Table of Contents



ProbeWriter

The ProbeWriter helps with managing a connection with ohmage to send probe data. It has the methods connect() and close() which help connect to ohmage. The ProbeWriter is a wrapper around the two aidl methods exposed by ohmage, writeProbe and writeResponse. These two methods are handled by write for Probes, and writeResponse for Responses. The ProbeWriter can be used by itself to write probe data to ohmage, or the two Builders can be used to help with the process of formatting the data correctly.



What does it do?

Creates a connection to ohmage so it can receive probes and responses.

Input Parameters

None

Return value

True if a connection is being created.

Back to Top



What does it do?

Closes the connection with ohmage

Input Parameters

None

Return value

None

Back to Top



What does it do?

Writes a probe to ohmage. The connection will be started if necessary.

Input Parameters

Parameter Description
observerId The unique ID defined by the observer.
observerVersion The version of the observer you are trying to send data to.
streamId The name of the specific stream the data should be sent to. This should be a stream defined in the observer xml.
streamVersion The version of the stream.
metadata The formated metadata for this probe as a JSON string.
data The formated data for this probe as a JSON string as defined by the avro schema.

Return value

None

Back to Top



What does it do?

Writes a response to ohmage

Input Parameters

Parameter Description
campaignUrn The campaign urn that this response belongs to.
campaignCreationTimestamp The creation timestamp of the campaign.
data The formated data for this response as a JSON string. The format of this data is described by the Survey Response JSON Format here.

Return value

None

Back to Top



ohmageProbeExample

The ohmageProbeExample apk shows how to use this library. More info can be found here.

Back to Top

Clone this wiki locally