Skip to content

Document Processing on a Web Service

To get the maximum performance and ease the document processing on a mobile side, you can perform the document processing on the Document Reader Web API.

graph LR
  A(Mobile SDK) --->|Request| B(Web API Service);
  B --->|Response| A;

Benefits:

  • The document processing is passed faster. 🚀
  • The size of the mobile application becomes as little as nothing. 🤯
  • There is no need to have your own backend - the document processing can be performed on our public one. Using it, you accept our Privacy Policy. Otherwise, use yours. 🎉

Usage

Permissions

Add the INTERNET permission to your AndroidManifest file - it's needed to send requests to the Web API service.

AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />

Set Up

To process the document on the Web API service, it's enough to specify the processing mode to be used by the Mobile SDK, and then pass it to the configuration object:

OnlineProcessingConfig config = new OnlineProcessingConfig.Builder(OnlineMode.MANUAL).build();
DocumentReader.Instance().functionality().edit().setOnlineProcessingConfiguration(config).apply();

By default, the FullProcess scenario is used to proces the document on the Web API service. You can change it, and/or turn on/off other configuration settings in the setProcessParams method passing it to the configutation object.

The MANUAL mode of processing means that the document processing has to be performed fully on the Web API service, while Mobile SDK is used only to capture document images, and then pass it to the service.

The AUTO mode of processing means that the document processing has to be performed on the mobile side and then on the Web API service as well. In this case, you need to add the Core framework as a part of the Document Reader SDK, add the database, if applicable, and perform the initialization afterwards.

Start the Processing

Now, you can start the document processing:

DocumentReader.Instance().showScanner(this, completion);

private final IDocumentReaderCompletion completion = (action, documentReaderResults, e) -> {
    if (action == DocReaderAction.COMPLETE || action == DocReaderAction.TIMEOUT) {
        Log.d("MainActivity", "Results: " + documentReaderResults);
    }

    if (action == DocReaderAction.ERROR) {
        Log.d("MainActivity", "ERROR: " + e.getMessage());
    }
};

See other options of the document processing here.

Processing Modes

MANUAL

  • There is no need to add the Core framework.
  • There is no need to add the database.
  • There is no need to perform the initialization process.
  • The processing is performed fully on the backend.

 

AUTO

  • Add the Core framework.
  • Add the database, if applicable.
  • Perform the initialization process.
  • The processing is performed on both mobile and web sides.

Next Steps