Skip to main content

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​

val configuration = MobbScanConfiguration().apply {
setBackButtonVisible(true)
}

MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_KEY", context, { licenseResult, validTo ->
// ...
}, configuration)
MobbScanAPI.getInstance().setBaseUrl("YOUR_MOBBSCAN_URL")

Environment​

MethodDescription
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.

OptionTypeDefaultDescription
imagesList<MobbScanImageType>nullOptional list of document image types to make available after a scan process.
falsePositiveControlBooleantrueChecks that the detected document side is the expected one.
qaControlBooleantrueEnables or disables all quality checks at once.
checkDocumentLightnessBooleantrueChecks that the document is neither too dark nor too bright.
checkDocumentPositionBooleantrueChecks that the document is inside the detection box, neither too far nor too close.
checkDocumentSparklesBooleantrueChecks that there are no glares on the document.
checkDocumentBlurringbooleantrueChecks that the document is in focus.
checkFacialLightnessBooleantrueChecks that the light on the face is neither too dark nor too bright.
checkFacialPositionBooleantrueChecks that the face is inside the frame, neither too far nor too close.
checkFacialFocusBooleantrueChecks that the face is in focus.
checkFacialMaskBooleantrueChecks that the face is not covered by a mask.
checkFacialSunglassesBooleantrueChecks that the user is not wearing sunglasses.
checkFacialNumFacesBooleantrueChecks the number of faces in the captured image.
checkFacialResolutionBooleantrueChecks the resolution of the detected face image.
returnUncroppedImageBooleanfalseReturns the uncropped document image from detection.
useTakePictureMode(boolean)booleanfalseTakes 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.
lightModebooleanfalseUses ambient light with the front camera during face capture.
scanFullSizeImages(boolean)booleantrueSends 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)booleanfalseShows the back button in the toolbar of SDK screens.
setCancellationDialogEnabled(boolean)booleantrueAsks 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:

MobbScanAPI.getInstance().fixedMode = MobbScanAPI.FixedMode.PORTRAIT
ValueBehaviour
NONEFollows the device orientation (default)
PORTRAITLocks the capture screen in portrait
LANDSCAPELocks the capture screen in landscape