Skip to content
cketcham edited this page Jun 27, 2012 · 5 revisions

RemoteActivity essentially allows for the creation of a customized prompt written specifically for a campaign.

How to create a remote activity

  1. Write an android application with at least one activity which returns a JSON object with at least one key, 'score', whose value is a double.
  2. Specify the prompt in your campaign XML as defined in the Campaign Definition Page
  3. Install the android application you wrote along with ohmage on the phone.

Example

Here is an example remote activity which always returns '0.0' when it is run:

``

Here is the prompt specification in the campaign xml

<prompt> <id>AttentionGame</id> <displayType>event</displayType> <displayLabel>Attention Game</displayLabel> <unit>Score</unit> <promptText>Press the button below to play the game. To play, tap every letter except the letter 'X'.</promptText> <abbreviatedText>Attention Game</abbreviatedText> <promptType>remote_activity</promptType> <properties> <property> <key>package</key> <label>edu.ucla.cens.FocusGame</label> </property> <property> <key>activity</key> <label>edu.ucla.cens.FocusGame.Game</label> </property> <property> <key>action</key> <label>edu.ucla.cens.FocusGame.Game.LAUNCH</label> </property> <property> <key>autolaunch</key> <label>false</label> </property> <property> <key>retries</key> <label>10</label> </property> <property> <key>min_runs</key> <label>1</label> </property> </properties> <skippable>true</skippable> <skipLabel>Skip</skipLabel> </prompt>

Clone this wiki locally