CommCare is an extensible form management application with a number of hooks to enable integration with other Android applications that want to use CommCare as a form entry engine or as a data backend. The CommCare support library provides a set of utility functions for using these APIs mobile APIs without having to understand and implement the underlying Android Cursors and Intents.
The support library is hosted on JCenter.
You can include this in Gradle in your build.gradle
:
repositories {
...
jcenter()
}
and:
dependencies {
...
implementation 'org.commcare:support-library:12.3'
}
Get the name of a case by its case_id
:
CaseUtils.getCaseName(Context context, String caseId)
Get the value of a specified property of a case by its case_id
:
CaseUtils.getCaseProperty(Context context, String caseId, String caseProperty)
Or get an entire list of case properties:
CaseUtils.getCaseProperties(Context context, String caseId, ArrayList<String> caseProperties)
Get a list of all the caseIds in the current user database:
CaseUtils.getCaseIds(Context context)
Get a list of IDs of all the fixtures in the current database:
FixtureUtils.getFixtureIdList(Context context)
Then retrieve the XML for a specific fixture from this list:
FixtureUtils.getFixtureXml(Context context, String fixtureId