Orba One
Search…
Android
This document explains how to integrate the Orba One authentication flow into your android application.

1. Install as a Gradle Plugin

The SDK works on API 21+. To fetch with Gradle, make sure you add the Orba One maven repository in your root project's build.gradle file:
1
repositories {
2
...
3
mavenCentral()
4
}
Copied!
Then add the following dependency to your app build.gradle file. You should replace the + with your desired version of the SDK.
1
dependencies {
2
...
3
implementation 'com.orbaone:orba-one-sdk:+'
4
}
Copied!
Now sync your build gradle to install the sdk.

2. Initializing the SDK

The Orba One SDK uses a publishable api key and an applicant id that you can obtain from your vendor dashboard. Your Publishable Api key and Applicant Id will be needed in order to initialize the SDK in your mobile app. A sample implementation is shown below.
1
import com.orbaone.orba_one_capture_sdk_core.OrbaOne;
2
3
OrbaOne oneSdk = new OrbaOne.Builder().setApiKey("publishable-api-key").setApplicantId("applicant-id").create();
4
oneSdk.startVerification(this);
Copied!

3. Handling Verifications

Orba One exposes two callbacks in order to let you know if the user has completed or cancelled the verification flow. A third callback (onStartVerification) is also supplied to alert you if the user has successfully began the flow.
1
oneSdk.onStartVerification(new OrbaOne.Response() {
2
@Override
3
public void onSuccess() {
4
// Flow started
5
}
6
7
@Override
8
public void onFailure(String message) {
9
// Flow not started
10
}
11
});
12
13
oneSdk.onCompleteVerification(new OrbaOne.Callback() {
14
@Override
15
public void execute(String key) {
16
// Flow completed successfully. The applicant id is also returned as a parameter.
17
}
18
});
19
20
oneSdk.onCancelVerification(new OrbaOne.Callback() {
21
@Override
22
public void execute() {
23
// Flow cancelled by the user.
24
}
25
});
Copied!

4. Customizing the Flow

To customize the verification flow, you can simply make use of the sdk's builder class. All customization must be done before starting the flow.
1
import com.orbaone.orba_one_capture_sdk_core.OrbaOne;
2
import com.orbaone.orba_one_capture_sdk_core.helpers.Step;
3
4
Step[] FlowStep = new Step[] {
5
Step.INTRO, // Welcome step - gives your user a short overview of the flow. [Optional, Default].
6
Step.ID, // Photo ID step - captures the user's identification document. [Default].
7
Step.FACESCAN, // Selfie Video step - captures a video of the user for liveness detection. [Default].
8
Step.COMPLETE // Final Step - informs the user that the verification process is completed. [Optional].
9
};
10
11
OrbaOne oneSdk = new OrbaOne.Builder()
12
.setApiKey("publishable-api-key")
13
.setApplicantId("applicant-id")
14
.setFlow(FlowStep)
15
.create();
16
oneSdk.startVerification(this);
Copied!

5. Customizing the Document Capture Step

To customize the document capture step, you can simply make use of the sdk's DocumentCaptureStep builder class. By using this builder class, you are able to exclude specified documents and countries from the capture flow. All customization must be done before starting the flow.
1
import com.orbaone.orba_one_capture_sdk_core.OrbaOne;
2
import com.orbaone.orba_one_capture_sdk_core.documentCapture.CountryCode;
3
import com.orbaone.orba_one_capture_sdk_core.documentCapture.DocumentCaptureStep;
4
import com.orbaone.orba_one_capture_sdk_core.helpers.DocumentTypes;
5
6
DocumentCaptureStep captureConfig = new DocumentCaptureStep.Builder()
7
.excludeDocument(new DocumentTypes[]{
8
DocumentTypes.PASSPORT, // this will remove the Passport option
9
DocumentTypes.DRIVERSLICENSE, // this will remove the Driver's License option
10
DocumentTypes.NATIONALID // this will remove the National ID option
11
})
12
.excludeCountry(new CountryCode[] {
13
CountryCode.JM, // this will remove Jamaica from the list of available countries
14
CountryCode.US // this will remove the United States from the list of available countries
15
})
16
.create();
17
OrbaOne oneSdk = new OrbaOne.Builder()
18
.setApiKey("publishable-api-key")
19
.setApplicantId("applicant-id")
20
.setDocumentCapture(captureConfig)
21
.create();
22
oneSdk.startVerification(this);
Copied!

6. Customizing the Theme

To ensure that Orba One fits in to your app's existing user experience, you can customize various colors by overriding the following in your colors.xml file.
orbaColorPrimary: Defines the background color of the Toolbar. orbaColorPrimaryDark: Defines the background color of the Statusbar. orbaColorAccent: Defines the outline of the play button as well as other details found in alert dialogs. orbaColorTextPrimary: Defines the text color of the Title in the Toolbar. orbaColorTextSecondary: Defines the text color of the Sub-title in the Toolbar. orbaColorButtonPrimary: Defines the background color of Primary Buttons and the text color of Secondary Buttons. orbaColorButtonPrimaryText: Defines the text color of Primary Buttons. orbaColorButtonPrimaryPressed: Defines the background color of Primary Buttons when pressed.

Sample App

A sample app demonstrating the Orba One SDK's implementation has been included. See the AndroidSample directory for the Android - Java implementation.

Support

Please post all issues through Github. If your query involves sensitive information, you may contact us at [email protected] with the subject ANDROID ISSUE: .
Last modified 7d ago