Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt

This page provides high-level guidance for how to integrate your CommCare application with other Android applications.

Multiexcerpt include macro
macro_uuid9078ada9-7c16-4fe4-af1c-4ddd91c1ebe9
nameSoftware Plan - Advanced
templateDataeJyLjgUAARUAuQ==
page[Internal] CommCare Public Management
addpanelfalse

Table of Contents
stylenone

Overview

CommCare offers a few options for integrating with external applications, including providing a Content Provider for accessing case and fixture data and Broadcasts for detecting events like syncs and submissions. However, Intent Callouts are the most common and robust option for integrating applications as part of the form entry workflow. The goal of such integrations is usually to have your custom external application appear as seamlessly as if it were a native question type, with resultant data ending up in the CommCare session such that this data is manipulable and submittable by CommCare.

...

  • 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

...

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:

...