Detect and scan a document in two different calls
Overview
At the getting started guide it was showed a way of performing both the detection and the scan with a single call, nevertheless, that might not be the use case for your application, and you would like to separate this two actions from one another. In this case, you can do a two step scan.
In order to perform these actions, you should have previously called the initAPI
method and the startScan
method to get the scanId
. If you don't know how to do this, please visit the getting started guide.
First, launch the document detection step:
MobbScanAPI.getInstance()
.detectDocument(documentSide) { result, resultData, error -> TODO("Place here your code") }
MobbScanAPI.getInstance().detectDocument(documentSide, (result, resultData, error) -> {
// TODO Place your code here
});
Then you can choose to start the scan as soon as you receive the detection event or save the image and use it later.
MobbScanAPI.getInstance().scanDocument(
documentSide, scanId, detectedImage
) { result, resultData, error -> TODO("Place here your code") }
MobbScanAPI.getInstance()
.scanDocument(documentSide, scanId, detectedBitmap,
(result, resultData, error) -> {
// TODO Place your code here
});