-
Notifications
You must be signed in to change notification settings - Fork 2
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.
Creates a connection to ohmage so it can receive probes and responses.
None
True if a connection is being created.
Closes the connection with ohmage
None
None
Writes a probe to ohmage. The connection will be started if necessary.
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. |
None
Writes a response to ohmage
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. |
None
The ohmageProbeExample apk shows how to use this library. More info can be found here.