Check Scanner UI Components | Android Document Scanner
Introduction
The Scanbot SDK provides the ability to scan and extract content from Checks.
The following Check standards are supported:
- USACheck - a check compatible with the ASC X9 standard used in the USA
- FRACheck - a check format commonly used in France
- KWTCheck - a check format commonly used in Kuwait
- AUSCheck - a check compatible with the Australian Paper Clearing System check standard
- INDCheck - a check compatible with the CTS-2010 standard issued by the Reserve Bank of India in 2012
- ISRCheck - a check format commonly used in Israel
- UAECheck - a check format commonly used in the United Arab Emirates
- CANCheck - a check format commonly used in Canada
The following fields are supported:
- Routing Number
- Account Number
- Check Number
- Sort Code
- Aux Domestic
- BSB
- Extra Aux Domestic
- Transaction Code
- Serial Number
- Sort Number
- Auxiliary On Us
The Check Scanner is available as an RTU UI and as a classic component (types of components are explained here).
Integration
Take a look at our Example Apps to see how to integrate the Check Scanner.
- Ready-To-Use UI: ready-to-use-ui-demo
- Classic UI Components: check-scanner
Add Feature as a Dependency
CheckScanner
is available with SDK Package 4. You have to add the following dependencies for it:
implementation("io.scanbot:sdk-package-4:$latestVersion")
implementation("io.scanbot:sdk-check-assets:$latestSdkVersion")
Please do not use multiple scanners at the same time. For example, do not combine generic document scanner, health insurance scanner, text data scanner, etc. at the same time! Each scanner instance requires a lot of memory, GPU, and processor resources. Using multiple scanners will lead to performance issues for the entire application.
Initialize the SDK
In order to use the Check Scanner you need to initialize the Scanbot SDK.
loading...
Unfortunately, we have noticed that all devices using a Cortex A53 processor DO NOT SUPPORT GPU acceleration. If you encounter any problems, please disable GPU acceleration for these devices.
ScanbotSDKInitializer()
.allowGpuAcceleration(false)
Ready-To-Use UI Component
Ready-To-Use UI Component (activity) that is responsible for recognizing Checks is CheckScannerActivity
.
Have a look at our end-to-end working example of the RTU components usage here.
Starting and configuring RTU Check Scanner
First of all, you have to add the SDK package and feature dependencies as described here.
Initialize the SDK as described here. More information about the SDK license initialization can be found here.
To use any of the RTU UI components you need to include the corresponding dependency in your build.gradle
file:
implementation("io.scanbot:sdk-package-ui:$scanbotSdkVersion")
Get the latest $scanbotSdkVersion
from the Changelog.
To start the RTU UI Check Scanner you only have to start a new activity and be ready to process its result later.
- AndroidX Result API
- old 'startActivityForResult' approach
loading...
loading...
We offer some syntactic sugar for handling the result from RTU components via AndroidX Result API:
every RTU component's activity contains a
Result
class which, in turn, along with theresultCode
value exposes a BooleanresultOk
property. This will be true ifresultCode
equalsActivity.RESULT_OK
;when you only expect
Activity.RESULT_OK
result code - you can use theAppCompatActivity.registerForActivityResultOk
extension method instead ofregisterForActivityResult
- it will be triggered only when there is a non-nullable result entity present.
Always use the corresponding activity's static newIntent
method to create intent when starting the RTU UI activity using deprecated startActivityForResult
approach. Creating android.content.Intent
object using its constructor (passing the activity's class as a parameter) will lead to the RTU UI component malfunctioning.
An instance of CheckScannerConfiguration
is required for starting the RTU UI activity. It allows configuration changes through methods it exposes:
loading...
All parameters in CheckScannerConfiguration
are optional.
API references for all of these methods can be found on this page.
Handling the result
Below is a simple example of presenting the result: CheckScanningResult
fields, shown in a Toast notification.
loading...
It is also possible to use the GenericDocumentWrapper
successors to use strongly typed objects and conveniently get access to the fields of the corresponding check.
To receive an instance of the scanned check wrapper, use io.scanbot.check.entity.GenericDocumentLibrary
or wrap()
extension function as follows:
loading...
Full API references for the result class are available here.
Classic component
To integrate the classic component of the Check Scanner you can take a look at our Check Scanner Example App or check the following step-by-step integration instructions.
CheckScanner
can be used in conjunction with ScanbotCameraXView
or separately. Let's have a look at an example with ScanbotCameraXView
.
Add feature dependencies and initialize the SDK
First of all, you have to add the SDK package and feature dependencies as described here.
Initialize the SDK as described here. More information about the SDK license initialization can be found here.
Get CheckScanner
instance from ScanbotSDK
and attach it to ScanbotCameraXView
loading...
Add a result handler for CheckScannerFrameHandler
loading...
handle
will be triggered every time CheckScanner
detects a check in the camera preview frame or if a license error has occurred.
After a successful check detection you will receive the result in CheckScannerFrameHandler.ResultHandler
callback - you will get CheckScanningResult
object that contains all recognized data:
status: CheckScannerStatus
- represents the status of the scanning processcheck: GenericDocument?
- represents all recognized check fields (accountNumber
,routingNumber
,checkNumber
, etc.)
Full API references for the result class are available here.
You can now run your app and should see a simple camera preview that can scan check data from your document.
Add a Finder Overlay
In addition, it is recommended to add a "Finder Overlay". This feature allows you to predefine a Check area over the ScanbotCameraXView
screen. By using this overlay the Check Scanner can skip the time-consuming step "Search for Check area" and perform the recognition directly in the specified "Finder Overlay" area. By using this approach the Check Scanner recognizes and extracts the Check content much faster.
Details about applying finder view logic in the layout and in the code can be found here.
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get your free Trial LicenseWhat do you think of this documentation?
What can we do to improve it? Please be as detailed as you like.