Multiexcerpt include macro | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
Question ID: as usual
Intent ID: intent action for your activity - for example "android.intent.action.DIAL" to launch the phone dialer
Extra: keys and paths to form fields containing the values of arguments for the intent activity
The paths point to the location of this data - no hard-coding of values. The paths can point to hidden values that calculate the desired value
Response: any extra values for ODK to store, along with the paths of where to store them
...
Further, this question itself (test_app_callout) can also be set to a value as a result of the callout.
Expand | |||||
---|---|---|---|---|---|
| |||||
CommCare additionally supports customizing the button text and setting intent type by editing the underlying XForm XML and setting the following attributes on the odkx:intent element:
As an example, the following XML sets the intent type to "vnd.android-dir/mms-sms" and the button label to "Send SMS". AndroidManifest.xml
|
...
For the source code referred to in this document please refer to this application. (Additionally, you may also refer to this standalone Android application provides demo of API integrations that are provided by CommCare.)
First, in our AndroidManifest.xml we will need to register an intent-filter to listen for CommCare's call out. This will look like:
...