Skip to main content

Android SDK

Getting Started

Latest release: Version 0.2.7


Device Requirnment

  • API level 23 (Android 6.0) or higher
  • Internet connection
  • Camera

Project Requirnment

  • AndroidX Support

    • ShuftiPro SDK requires AndroidX 1.0.0 or later. If you haven't switched to AndroidX in your app yet then follow this guide.
  • Enable Java 8

    • ShuftiPro SDK requires Java 8 language features to be enabled in your project. If you don't have this enabled already then add this to your app/build.gradle file under the android section:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8


  • Integration Sample (Java): Shufti Pro Android Android-SDK



It’s always recommended to use the updated version

Step 1: Go to root-level setting.gradle in your project and add the following:

dependencyResolutionManagement {
repositories {
maven { url '' } // Add this line

Step 2: In build.gradle(Module) add the following implementation

implementation 'com.github.shuftipro:ShuftiPro_SDK:0.2.6'

Basic Usage


Note: Make sure you have obtained client id and secret key or access token before proceeding


Shufti Pro provides two types of authorization to its users. The following shows the code snippet of how to use the authorization keys to authenticate the SDK.

  • Basic Auth

    Make auth object using client id and secret key
JSONObject AuthKeys = new JSONObject();
try {
AuthKeys.put("client_id", "your-clientId");
} catch (JSONException e) {
  • Access Token

    Or make auth object using access token
JSONObject AuthKeys = new JSONObject();

You can get client id or secret key and generate access token like this

Auth object parameters are explained here.


The Shufti Pro’s mobile SDKs can be configured on the basis of parameters provided in the config object.

        JSONObject Config=new JSONObject();
Config.put("open_webview",false); //pass true for verification through hybrid view
Config.put("dark_mode", false);
Config.put("video_kyc", false);

Config object parameters are explained here.

Request Object

This object contains the service objects and their settings through which the merchant wants to verify end users. Request Object sample

JSONObject requestObject = new JSONObject();

requestObject.put("reference", "12345678");
requestObject.put("country", "US");
requestObject.put("language", "EN");
requestObject.put("email", "");
requestObject.put("callback_url", "");
requestObject.put("verification_mode", "image_only");
requestObject.put("show_results", "1");

//Creating Face object

JSONObject faceObject = new JSONObject();
faceObject.put("proof", "");
requestObject.put("face", faceObject);

//Creating Document object

JSONObject documentObject = new JSONObject();
ArrayList<String> doc_supported_types = new ArrayList<String>();

documentObject.put("proof", "");
documentObject.put("additional_proof", "");

JSONObject docNameObject = new JSONObject();
docNameObject.put("first_name", "Johon");
docNameObject.put("middle_name", "Johsan");
docNameObject.put("last_name", "Livone");

documentObject.put("name", docNameObject);
documentObject.put("dob", "1980-11-12");
documentObject.put("document_number", "19901112");
documentObject.put("expiry_date", "1996-11-12");
documentObject.put("issue_date", "1990-11-12");
documentObject.put("backside_proof_required", "0");
documentObject.put("supported_types",new JSONArray(doc_supported_types));
documentObject.put("nfc_verification", false); // add "true" value for nfc verification along with nfc dependency

requestObject.put("document", documentObject);

//Creating Document Two Object is exactly same as document object.
// Add document two to request object like

requestObject.put("document_two", documentTwoObject);

//Creating Address object

JSONObject addressObject = new JSONObject();
ArrayList<String> address_supported_types = new ArrayList<String>();

addressObject.put("proof", "");

JSONObject addressNameObject = new JSONObject();
addressNameObject.put("first_name", "Johon");
addressNameObject.put("middle_name", "Johsan");
addressNameObject.put("last_name", "Livone");
addressObject.put("name", addressNameObject);
addressObject.put("full_address", "ST#2, 937-B, los angles.");
addressObject.put("supported_types",new JSONArray(address_supported_types));
requestObject.put("address", addressObject);

//Creating consent object

JSONObject consentObject = new JSONObject();
ArrayList<String> consent_supported_types = new ArrayList<String>();

consentObject.put("proof", "");
consentObject.put("text", "This is my consent test");
consentObject.put("supported_types",new JSONArray(consent_supported_types));

requestObject.put("consent", consentObject);

//Creating phone object

requestObject.put("phone", "");

//Creating BGC object

requestObject.put("background_checks", "");


Shufti Pro’s mobile SDK can be initialised by using the given method and passing auth, config and request object as the parameters.

Shuftipro shuftipro = Shuftipro.getInstance();
shuftipro.shuftiproVerification(JSONObject: "your-requested-json-object",
new ShuftiVerifyListener() {
public void verificationStatus(HashMap<String, String> responseSet) {



Verification Types

Native Flow

In the native verification flow, the end-user interacts with the native mobile SDK. The native flow of verification tends to be much faster since the whole app depends on the device's processing power for the verification process. Also, all the proofs are taken for all services in native flow first and then and only then, is a request made to the server in the form of JSONObject.
You can enable native flow by passing false for open_webview key in Config object.


Hybrid Flow

The hybrid verification flow includes mobile verifications on a web view built on HTML 5 that will show the verification process to the end user. End-user provides the information in the online customer onboarding process. In hybrid flow, proofs are uploaded as every service is performed, verification results are shown simultaneously in case of decline, and the user can retry the request.
You can enable native flow by passing true for open_webview key in Config object.


In both flows, Shufti Pro provides the facility to their customers to tailor the identity verification services according to their needs.

SDK Flow


Call backs are received whenever the SDK is terminated or closed whether it is after request completion or if the user leaves the verification journey mid way. The call backs are received in

 new ShuftiVerifyListener() {
public void verificationStatus(HashMap<String, String> responseSet)

Following is the list of callbacks we receive in the above function.

Eventrequest.unauthorizedThe auth header is not correct and, client id/secret key may be invlaid.
Eventrequest.pendingThis event is returned for all on-site verifications until the verification is completed or timeout.
Eventverification.acceptedVerification accepted callback
Eventverification.declinedVerification declined callback
Eventpermission.deniedThis event is returned if the user did not give camera and other permissions to sdk.
Eventrequest.timeoutThis will occur if request has timed-out
Eventverification.cancelledThis callback is returned when verification is cancelled midway by the end user
Eventrequest.receivedThis event states that the verification request has been received and is under processing
Eventrequest.invalidThe request invalid event occurs when the parameters specified in the request payload are not in the correct format.
ErrorInternet Connection ErrorThis callback is returned in case of lost internet connectivity
ErrorError OccuredThis callback is returned if some error occurs while processing request

You can check complete response of shuftipro from here

Callback Handling

All the callbacks can be handled inside the client’s calling activity. The response and callback handling can be seen below.

On SDK Completion

// Verification accepted callback
else if(responseSet.get("event").equalsIgnoreCase("verification.declined")){
// Verification declined callback

On SDK Unauthentication

else if(responseSet.get("event").equalsIgnoreCase("request.unauthorized")){
// Verification unauthorized callback. This event occurs when the auth header or its parameters are invalid.

On SDK Error

else if(responseSet.get("event").equalsIgnoreCase("permission.denied")){
// This callback is returned in case the permissions are declined by the end user.
else if(responseSet.get("event").equalsIgnoreCase("request.timeout")){
// This callback is returned in case request took too long and is timed out
else if(responseSet.get("event").equalsIgnoreCase("verification.cancelled")){
// This callback is returned when verification is cancelled midway by the end user
else if(responseSet.get("event").equalsIgnoreCase("request.invalid")){
// This callback is returned if the request parameters are incorrect.
else {
// Some error has been occured during the verification process


ShuftiPro supports a set of customisation options that will influence the appearance of the mobile SDK.

Verification flow and UI

The complete verification journey is customisable. To remove the screen from verification flow, you need to provide that parameter to the SDK through request/config object. For instance;

Request Object

"show_consent" : "0" // providing this parameter 0 value will hide the verification consent screen

"country" : "GB" // providing a value to this parameter will not ask the end user to provide his country

"verification_mode" : "image_only" // "image_only" or "video_only" values will allow you to avoid mode selection at real-time

"show_privacy_policy" : "0" // value will remove the privacy policy content shown at result screen

"allow_online" : "1" // 1 value will ask the user to capture real time proofs(image or video) depending upon verification mode

"allow_offline" : "1" // 1 value will ask the user to upload proofs(image or video) depending upon verification mode

"decline_on_single_step" : "1" // this parameter will work with onsite flow(open_webview : true). This will show continue the journey only if pervious step is successfully verified

"show_feedback_form" : "1" // this parameter will work with onsite flow(open_webview : true). 1 value will ask the user for its feedback at the end of verification

// Service Level Parameters

"supported_types" : [id_card] // providing a single value to this parameter will not ask the user for document type

"show_ocr_form" : "1" // this parameter will work with onsite flow(open_webview : true). 1 value will show the OCR form to the user

Config Object

"asyncRequest": "true" // passing true value to this parameter will not show result screen to the user and will just return the callback on request completion


The colour of buttons and font can be customised by overriding the values of following variables in the project's color.xml file.

<color name="light_button_color">#2B6AD8</color>
<color name="light_text_color">#1D2C42</color>
<color name="dark_button_color">#FF7A77</color>
<color name="dark_text_color">#ffffff</color>
<color name="button_text_color">#FFFFFFFF</color>


Shufti Pro provides its users the facility to translate the SDK entirely in their desired language or customise the text of SDK according to their requirements. The text of the SDK can be customised by changing the values of corresponding variables given in this strings.xml file. The user just has to override the values of desired variables in their own project’s strings.xml file.

Dark mode

To apply and use dark theme/mode in SDK, initialise the SDK with provided parameters in the config object.

        Config.put("dark_mode",  true);

NFC verification

Near Field Communication (NFC) is a set of short-range wireless technologies. NFC allows sharing small payloads of data between an NFC tag and an NFC-supported device. NFC Chips found in modern passports and similar identity documents contain additional encrypted information about the owner. This information is very useful in verifying the originality of a document. NFC technology helps make the verification process simple, quicker and more secure. This also provides the user with contactless and input less verification. ShuftiPro's NFC verification feature detects MRZ from the document to authenticate NFC chips and retrieve data from it, so the authenticity and originality of the provided document could be verified.


If you have successfully integrated main SDK, now you can easily integrate our NFC SDK simply by adding the dependency in app level bulid.gradle along with main SDK's dependency:

dependencies {
implementation 'com.github.shuftipro:NFC:2.1.9'

Note: Nfc verification is allowed only on e-passports under document, document_two and address service only. The nfc service is not available in hybrid webview for now.


SDK VersionsChanges
  • Added video KYC service inside SDK in which users can verify identity through video calls with the shuftipro agent.
  • Tap to focus feature is added to camera
  • Image quality while capturing proofs, is increased
  • Improved internet connectivity checks, SDK will now check for limited internet connections
  • Onsite SDK crash log due to unhandled exception is resolved.
  • Logging mechanism for failed nfc tries added
  • UI for nfc verification was improved
    • Animated instruction(gif) for NFC was improved
    • Data representation was improved
  • Option to switch between visual and textual instructions is added
  • Support for android 13 added.
    • Android 13 do not require storage permission. So, the need of storage permission was removed for android 13.
  • Improved instructions for face verification
    • More accurate instructions were added in image form