The Predictive Document Verification (DocV) Android SDK v3 provides a framework to add image capture and upload services to your mobile application.
- Android SDK Version 22 (OS Version 5.1) and later
- Android SDK is compiled with
compileSdkVersion 32
and Java 11
The DocV Android SDK v3 allows integration as simple as writing a single line of code:
SocureDocVHelper.getIntent(context, socure_sdk_key, config)
Argument | Description |
---|---|
SocureDocVHelper |
A SDK helper class. |
socure_sdk_key |
The unique SDK key obtained from Admin Dashboard. For more information on SDK keys, see the Getting Started. |
context |
Activity context |
config |
An optional JSON string or null value that specifies a custom flow. The your_custom_flow_name value specifies the name of the flow (created in Admin Dashboard) that the DocV SDK should use. "{'flow':{'name':'your_custom_flow_name'}}" If the value is null , the DocV SDK will fetch the default flow from Admin Dashboard. |
Before you can use the DocV Android SDK v3, you must perform the following steps:
In your root build.gradle
file, at the end of the allprojects
> repositories
section, add the Socure DocV SDK Maven repository.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
In your module level build.gradle
file, add the following Socure DocV SDK dependency:
dependencies {
implementation 'com.github.socure-inc:socure-docv:x.y.z'
}
The DocV Android SDK requires camera permission to capture identity documents. Upon the first invocation of the SDK, your app will request camera permission from the user.
Note: We recommend you check for camera permissions before calling the Socure DocV SDK’s launch API.
Ensure that your app manifest has been set up properly to request the following required permissions:
<uses-feature android:name="android.hardware.camera" />
<!-- Declare permissions -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
To launch the Socure DocV SDK, call the launch function using ActivityResultLauncher
.
val startForResult: ActivityResultLauncher<Intent> = registerForActivityResult(...)
...
startForResult.launch(SocureDocVHelper.getIntent(context, socure_sdk_key, config))
Once the Socure DocV SDK is successfully launched, you will be able to set up a listener for Callback Events and customize most aspect of the interface. For more information, see the Android SDK documentation on DevHub.