Configuration
Most options are set on a MobbScanConfiguration object that you pass to initAPI. The defaults are the recommended values; change them only when your use case needs it.
Apply a configuration
- Kotlin
- Java
val configuration = MobbScanConfiguration().apply {
setBackButtonVisible(true)
}
MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_KEY", context, { licenseResult, validTo ->
// ...
}, configuration)
MobbScanAPI.getInstance().setBaseUrl("YOUR_MOBBSCAN_URL")
MobbScanConfiguration configuration = new MobbScanConfiguration();
configuration.setBackButtonVisible(true);
MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_KEY", context, new LicenseStatusListener() {
@Override
public void onLicenseStatusChecked(MobbScanLicenseResult licenseResult, Date validTo) {
// ...
}
}, configuration);
MobbScanAPI.getInstance().setBaseUrl("YOUR_MOBBSCAN_URL");
Environment
| Method | Description |
|---|---|
setBaseUrl(String url) | URL of your MobbScan environment, provided by Mobbeel. Call it right after initAPI. |
MobbScanConfiguration options
While the camera is open, the SDK checks every frame and only accepts captures that are good enough to be processed. Quality checks are enabled by default.
| Option | Type | Default | Description |
|---|---|---|---|
images | List<MobbScanImageType> | null | Optional list of document image types to make available after a scan process. |
falsePositiveControl | Boolean | true | Checks that the detected document side is the expected one. |
qaControl | Boolean | true | Enables or disables all quality checks at once. |
checkDocumentLightness | Boolean | true | Checks that the document is neither too dark nor too bright. |
checkDocumentPosition | Boolean | true | Checks that the document is inside the detection box, neither too far nor too close. |
checkDocumentSparkles | Boolean | true | Checks that there are no glares on the document. |
checkDocumentBlurring | boolean | true | Checks that the document is in focus. |
checkFacialLightness | Boolean | true | Checks that the light on the face is neither too dark nor too bright. |
checkFacialPosition | Boolean | true | Checks that the face is inside the frame, neither too far nor too close. |
checkFacialFocus | Boolean | true | Checks that the face is in focus. |
checkFacialMask | Boolean | true | Checks that the face is not covered by a mask. |
checkFacialSunglasses | Boolean | true | Checks that the user is not wearing sunglasses. |
checkFacialNumFaces | Boolean | true | Checks the number of faces in the captured image. |
checkFacialResolution | Boolean | true | Checks the resolution of the detected face image. |
returnUncroppedImage | Boolean | false | Returns the uncropped document image from detection. |
useTakePictureMode(boolean) | boolean | false | Takes a high-resolution photo after detection instead of analyzing camera frames continuously. This can help with small print, at the cost of a slower capture. |
lightMode | boolean | false | Uses ambient light with the front camera during face capture. |
scanFullSizeImages(boolean) | boolean | true | Sends the whole captured image to the scan service instead of only the cropped document. The remote setting sdk.scanFullSizeImages, when set, takes precedence. |
setBackButtonVisible(boolean) | boolean | false | Shows the back button in the toolbar of SDK screens. |
setCancellationDialogEnabled(boolean) | boolean | true | Asks for confirmation before leaving a capture. If disabled, back navigation exits immediately. |
Disabling quality checks lets poor captures through and lowers data-extraction and face-matching accuracy. Keep them enabled in production. When a user leaves a capture, the callback receives USER_CANCELLED_ERROR or SCANNING_PROCESS_CANCELLED.
Pass the same MobbScanConfiguration to initAPI.
Orientation
By default the document screen follows the device orientation, so users can hold the document as they prefer. To lock it, set the fixed mode before starting a capture:
- Kotlin
- Java
MobbScanAPI.getInstance().fixedMode = MobbScanAPI.FixedMode.PORTRAIT
MobbScanAPI.getInstance().setFixedMode(MobbScanAPI.FixedMode.PORTRAIT);
| Value | Behaviour |
|---|---|
NONE | Follows the device orientation (default) |
PORTRAIT | Locks the capture screen in portrait |
LANDSCAPE | Locks the capture screen in landscape |