For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

File upload and QR management

Introduction

Document capture, as well as QR code reading and generation, are handled by the CaptureComponent.

This component lets you upload documents by taking a photo with the device camera or selecting one from the gallery.


Dependency

The component-specific dependency is:

implementation "com.facephi.androidsdk:capture_component:$version"

Available controllers

Controller

Description

FileUploaderController

Controller for document capture


Error handling

Errors are returned as a CaptureError object.

List of errors:

  • CAP_ACTIVITY_RESULT_MSG_ERROR: The result returned by the activity is incorrect or does not contain the information required to continue.

  • CAP_APPLICATION_CONTEXT_ERROR: The required application context is null or invalid, preventing the capture module from being initialized correctly.

  • CAP_CAMERA_ERROR: An internal error related to the device camera has occurred (opening, initialization, or capture failure).

  • CAP_CAMERA_PERMISSION_DENIED: The user denied the permissions required to access the camera.

  • CAP_CANCEL_BY_USER: The user manually canceled the capture process.

  • CAP_CANCEL_LAUNCH: The process was canceled in general by the SDK or by an external action.

  • CAP_COMPONENT_LICENSE_ERROR: The component license is invalid, has expired, or does not match the required configuration.

  • CAP_EMPTY_LICENSE: The license string is empty or has not been provided.

  • CAP_FETCH_DATA_ERROR: An error occurred while retrieving or processing the data required to run the flow. (Includes additional information in the error.)

  • CAP_FLOW_ERROR: An internal error occurred while running the capture flow. (Includes additional information in the error.)

  • CAP_INITIALIZATION_ERROR: An error occurred while initializing the SDK components required. (Includes detailed information in the error.)

  • CAP_FILE_UPLOADER_CAPTURE_ERROR: An error occurred while uploading the files generated during capture.

  • CAP_IMAGE_TOO_LARGE: The image selected from the gallery exceeds the maximum size configured in maxGalleryImageSizeKb.

  • CAP_MANAGER_NOT_INITIALIZED: The managers required to run the process have not been initialized correctly.

  • CAP_NO_DATA_ERROR: The required input data is null, missing, or insufficient to continue the process.

  • CAP_OPERATION_NOT_CREATED: An active operation required to continue could not be created or retrieved. (Includes detailed information in the error.)

  • CAP_QR_CAPTURE_ERROR: An error occurred while capturing or reading the QR code.

  • CAP_QR_GENERATION_ERROR: An error occurred while generating the requested QR code.

  • CAP_TIMEOUT: The maximum time allowed for one of the process stages has been reached.

  • CAP_FLOW_VIDEO_RECORDING_ERROR: An error occurred during Video Recording within the specified flow.

  • CAP_FLOW_TRACKING_ERROR: An error occurred while performing the Tracking required to complete the capture flow.

Document capture configuration

In FileUploaderConfigurationData, along with parameters such as allowGallery and maxScannedDocs, you can adjust how gallery selection behaves:

  • onlyGalleryMode: Opens the flow directly in gallery mode, without showing camera capture. By default, true.

  • maxGalleryImageSizeKb: Maximum allowed size, in KB, for images selected from the gallery. By default 2048. If an image exceeds this limit, the component returns CAP_IMAGE_TOO_LARGE.

Last updated