DocumentDetector v7.x or below
Supported documents
Currently, supported documents on Android are:
SDK size
The SDK size is approximately 3.3 MB, which may decrease due to these elements.
Runtime permissions
Instantiating the SDK
First things first, instantiate an object of type DocumentDetector
. This object will contain all your business rules for the SDK:
All parameters annotated with
@Nullable
can receivenull
values, useful if you want to configure only one of the parameters of the same method.
Builder method
Each environment (beta and production) requires its own specific mobileToken, generated in the Trust platform of the respective environment.
DocumentDetectorStep
To create a capture flow, you will need to create an array of DocumentDetectorStep
, where each element will be a capture step. To construct each DocumentDetectorStep
object, you can enter the following elements:
CaptureStage
To improve the client's UX, we recommend creating difficulty stages for the DocumentDetector. For this, we offer the CaptureStage object, where you can set the following parameters:
Since the .setCaptureStages
parameter is not required, if it is not used, the DocumentDetector
will use this default:
QualitySettings
DetectionSettings
UploadSettings
To enable the document upload functionality it is necessary to instantiate an object of type UploadSettings(boolean enable) and set its parameters:
Currently, the supported file formats are:
MessageSettings
To use, simply instantiate a MessageSettings
object and use the methods as needed for customization.
Example
Security validations
We are constantly taking actions to make the product more and more secure, mitigating a number of attacks observed in the capture process and, consequently, reducing as many possible identity frauds as possible. The SDK has some blocks that may prevent its execution in certain contexts. To disable them, you can use the methods as shown in the example below:
Disabling security validations is recommended for testing purposes only. For publishing your application in production, we recommend using the default settings.
Starting Activity
After creating the DocumentDetector
, start the DocumentDetectorActivity
by passing this object as a parameter via extra intent:
Getting the result
To get the DocumentDetectorResult
object, which contains the captures taken by the SDK, override the onActivityResult
method in the same Activity that you started the DocumentDetectorActivity
:
DocumentDetectorResult
Capture
Last updated