-
Notifications
You must be signed in to change notification settings - Fork 21
API Reference
-
org.idpass.smartscanner.lib.config
-
org.idpass.smartscanner.lib.extensions
-
org.idpass.smartscanner.lib.platform
AnalyzerType
BarcodeResult
MRZCleaner
MRZResult
SmartScannerAnalyzer
-
org.idpass.smartscanner.lib.utils
CameraUtils
DateUtils
FileUtils
-
org.idpass.smartscanner.lib.exceptions
SmartScannerException
Enumeration of supported barcode formats, from com.google.mlkit.vision.barcode.
BarcodeFormat.ALL
BarcodeFormat.AZTEC
BarcodeFormat.CODABAR
BarcodeFormat.CODE_39
BarcodeFormat.CODE_93
BarcodeFormat.CODE_128
BarcodeFormat.DATA_MATRIX
BarcodeFormat.EAN_8
BarcodeFormat.EAN_13
BarcodeFormat.ITF
BarcodeFormat.PDF_417
BarcodeFormat.QR_CODE
BarcodeFormat.UPC_A
BarcodeFormat.UPC_E
-
BarcodeFormat.default
: Default barcode formats, includes all the values above exceptBarcodeFormat.ALL
.
Data class to hold configuration for barcode scanning.
Constructor parameters:
Parameter | Type | Default | Description |
---|---|---|---|
barcodeFormats |
List<String> |
null |
Values are valid BarcodeFormat strings. |
barcodeScannerSize |
String |
null |
Value is a valid ScannerSize string. |
idPassLiteSupport |
Boolean |
null |
Static properties:
Property | Type | Description |
---|---|---|
BarcodeOptions.default |
BarcodeOptions |
Default barcode options. |
BarcodeOptoins.defaultIdPassLite |
BarcodeOptions |
Default barcode options for ID PASS Lite scanning. |
Data class to hold configuration for the SmartScanner user interface.
Constructor parameters:
Parameter | Type | Default | Description |
---|---|---|---|
regex |
String |
null |
returns text if it matches regex. |
type |
String |
null |
|
analyzeStart |
ImageResultType |
null |
Delays analyzing the image to give time for user to focus. |
Static properties:
Property | Type | Description |
---|---|---|
OCROptions.default |
OCROptions |
Default OCR options. |
Data class to hold configuration for the SmartScanner user interface.
Constructor parameters:
Parameter | Type | Default | Description |
---|---|---|---|
background |
String |
null |
|
font |
String |
null |
|
imageResultType |
ImageResultType |
null |
|
label |
String |
null |
|
isManualCapture |
Boolean |
null |
|
branding |
Boolean |
null |
|
showGuide |
Boolean |
null |
Show MRZ target guide. |
showOcrGuide |
Boolean |
null |
Show OCR target guide. |
xGuide |
Number |
null |
Sets MRZ and OCR target guide's offset horizontally. Takes values 0.0-1.0. |
yGuide |
Number |
null |
Sets MRZ and OCR target guide's offset vertically. Takes values 0.0-1.0. |
widthGuide |
Number |
null |
Sets the width of target guide for MRZ and OCR. |
heightGuide |
Number |
null |
Sets the height of target guide for MRZ and OCR. |
Static properties:
Property | Type | Description |
---|---|---|
Config.default |
Config |
Enumeration of supported fonts.
Fonts.NOTO_SANS_ARABIC
Fonts.ROBOTO
Fonts.SOURCE_SANS_PRO
Enumeration of supported image result types.
-
ImageResultType.PATH
: The image will be saved in the file system and return the path to the file. -
ImageResultType.BASE_64
: The image will be encoded in Base64 format and returned.
Enumeration of supported SmartScanner capturing mode.
-
Modes.BARCODE
: Capture barcodes. -
Modes.IDPASS_LITE
: Capture ID PASS Lite cards. -
Modes.PDF_417
: Capture PDF417. -
Modes.MRZ
: Capture MRZ. -
Modes.OCR
: Capture OCR. -
Modes.NFC_SCAN
: Capture NFC. -
Modes.QRCODE
: Capture QRCode.
Enumeration of supported MRZ formats.
Data class for configuration for the SmartScanner.
Constructor parameters:
Parameter | Type | Default | Description |
---|---|---|---|
mode |
Modes |
Modes.MRZ |
|
config |
Config |
null |
|
mrzFormat |
MrzFormat |
null |
|
barcodeOptions |
BarcodeOptions |
null |
Static properties:
Property | Type | Description |
---|---|---|
ScannerOptions.defaultForBarcode |
ScannerOptions |
Default options when scanning for barcode. |
ScannerOptions.defaultForMRZ |
ScannerOptions |
Default options when scanning for MRZ. |
ScannerOptions.defaultForIdPassLite |
ScannerOptions |
Default options when scanning ID PASS Lite cards. |
Static methods:
-
ScannerOptions.sampleMrz()
: Creates a newScannerOptions
for MRZ scanning configured with the provided parameters.- Parameters:
-
Returns:
ScannerOptions
-
ScannerOptions.sampleBarcode()
: Creates a newScannerOptions
for barcode and ID PASS Lite scanning configured with the provided parameters.-
Parameters:
-
config
:Config
-
barcodeOptions
:BarcodeOptions
-
-
Returns:
ScannerOptions
-
Parameters:
Enumeration of supported sizes for the scanner UI.
ScannerSize.SMALL
ScannerSize.MEDIUM
ScannerSize.LARGE
ScannerSize.CUSTOM_QR
Extends the Context
class with additional methods.
-
hideKeyboard()
: Hides the virtual keyboard for the givenView
.-
Parameters:
-
view
:View
-
-
Returns:
void
-
Parameters:
Extends the Bitmap
, Image
, and String
classes with additional methods.
-
cacheImageToLocal()
: Caches aBitmap
into the file system, with rotation and quality modifications.-
Parameters:
-
localPath
:String
. The path where the image will be written to. -
rotation
:Int
, default:0
. How much to rotate, in degrees. Accepts values from0
to360
. -
quality
:Int
, default:100
. Accepts values from0
to100
.
-
-
Return:
void
-
Parameters:
-
resizeBitmap()
: Resizes aBitmap
into the provided dimensions.-
Parameters:
-
newWidth
:Int
-
newHeight
:Int
-
-
Return: :
Bitmap
-
Parameters:
-
encodeBase64()
: Encodes aBitmap
into Base64.-
Parameters:
-
rotation
:Int
, default:0
. How much to rotate, in degrees. Accepts values from0
to360
.
-
-
Return:
String
, the Base64 representation of the image.
-
Parameters:
-
rotate()
: Rotates aBitmap
.-
Parameters:
-
rotation
:Int
, default:0
. How much to rotate, in degrees. Accepts values from0
to360
.
-
-
Return::
Bitmap
-
Parameters:
-
toBitmap()
: Converts anImage
object into aBitmap
object.-
Parameters:
-
rotation
:Int
, default:0
. How much to rotate, in degrees. Accepts values from0
to360
.
-
-
Return:
Bitmap
-
Parameters:
-
decodeBase64()
: Decodes aBitmap
from a Base64String
.- Parameters: None
-
Return:
Bitmap
, the decoded image.
-
toBitmap()
: Reads the file in file system path represented by theString
as aBitmap
.- Parameters: None
-
Return:
Bitmap
, the read image.
Extends the Context
class with additional methods related to network connectivity.
-
getConnectionType()
: Returns the current connection type.- Parameters: None
-
Return:
Int
-
0
: No connection -
1
: Cellular / mobile data -
2
: Wifi -
3
: VPN
-
Extends the Int
and Double
classes with additional methods.
-
Int.noValue()
: Static method that returns0
.
-
Double.noValue()
: Static method that returns0.0
.
Extends the String
class with additional methods.
-
String.empty()
: Static method that returns an empty string""
. -
String.space()
: Static method that returns a space" "
. -
String.formatToSimpleDate()
: Static method that formats a given date.-
Parameters:
-
date
:Date
-
-
Return:
String
representation of the date inyyyyMMddHHmmss
format.
-
Parameters: