Custom Integrations

Simprints ID can be integrated into any custom Android application with a few simple callouts. Make sure you have checked out our Getting Started page before continuing.

Setting up LibSimprints

  • LibSimprints is a library that can be used to integrate any custom Android application with Simprints ID.

  • LibSimprints consists of 2 components:

    • Constants file: Defines names of fields that Simprints ID expects to receive and return from/to any custom Android application

    • SimHelper: Class that helps to build requests and returns to/from Simprints ID with the right parameters according to the Constants file

  • The code repository for LibSimprints can be found here

To install the LibSimprints library follow the following steps:

Step 1: Install the latest version LibSimprints from GitHub (https://github.com/Simprints/LibSimprints)*

Gradle

implementation 'com.simprints:libsimprints:2020.3.0'

Maven

<dependency>

<groupId>com.simprints</groupId>

<artifactId>libsimprints</artifactId>

<version>2020.3.0</version>

<type>pom</type>

</dependency>

*Always check with your Simprints Project Manager what the latest version of LibSimprints is before continuing

When integrating with Simprints ID, you will need to pass 3 parameters to Simprints ID: Project ID, User ID and Module ID. To find out more about these parameters click here.

Follow the steps below to define the three parameters.

Step 2: Define the 3 parameters to pass to Simprints ID using the Constants file:

  • The Project ID:

Constants.SIMPRINTS_PROJECT_ID

  • The User ID:

Constants.SIMPRINTS_USER_ID

  • The Module ID:

Constants.SIMPRINTS_MODULE_ID

You are now ready to import the SimHelper class.

Using SimHelper

SimHelper is a class that will help you build Intents with the right parameters for Simprints ID and also process returns from Simprints ID.

Step 1: Import LibSimprints:

import com.simprints.libsimprints.*;

You should use the SimHelper class to make calls to/from Simprints ID

SimHelper simHelper = new SimHelper("Project ID", "User ID");

You are now ready to build specific Intents to:

Check out the OpenSRP-Simprints integration on Github for an example of an integration. This was written by one of our project partners, D-Tree.