-
Notifications
You must be signed in to change notification settings - Fork 23
API Reference
-
org.idpass.smartscanner.lib.config -
org.idpass.smartscanner.lib.extensions -
org.idpass.smartscanner.lib.platformAnalyzerTypeBarcodeResultMRZCleanerMRZResultSmartScannerAnalyzer
-
org.idpass.smartscanner.lib.utilsCameraUtilsDateUtilsFileUtils
-
org.idpass.smartscanner.lib.exceptionsSmartScannerException
Enumeration of supported barcode formats, from com.google.mlkit.vision.barcode.
BarcodeFormat.ALLBarcodeFormat.AZTECBarcodeFormat.CODABARBarcodeFormat.CODE_39BarcodeFormat.CODE_93BarcodeFormat.CODE_128BarcodeFormat.DATA_MATRIXBarcodeFormat.EAN_8BarcodeFormat.EAN_13BarcodeFormat.ITFBarcodeFormat.PDF_417BarcodeFormat.QR_CODEBarcodeFormat.UPC_ABarcodeFormat.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_ARABICFonts.ROBOTOFonts.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 newScannerOptionsfor MRZ scanning configured with the provided parameters.- Parameters:
-
Returns:
ScannerOptions
-
ScannerOptions.sampleBarcode(): Creates a newScannerOptionsfor 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.SMALLScannerSize.MEDIUMScannerSize.LARGEScannerSize.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 aBitmapinto 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 from0to360. -
quality:Int, default:100. Accepts values from0to100.
-
-
Return:
void
-
Parameters:
-
resizeBitmap(): Resizes aBitmapinto the provided dimensions.-
Parameters:
-
newWidth:Int -
newHeight:Int
-
-
Return: :
Bitmap
-
Parameters:
-
encodeBase64(): Encodes aBitmapinto Base64.-
Parameters:
-
rotation:Int, default:0. How much to rotate, in degrees. Accepts values from0to360.
-
-
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 from0to360.
-
-
Return::
Bitmap
-
Parameters:
-
toBitmap(): Converts anImageobject into aBitmapobject.-
Parameters:
-
rotation:Int, default:0. How much to rotate, in degrees. Accepts values from0to360.
-
-
Return:
Bitmap
-
Parameters:
-
decodeBase64(): Decodes aBitmapfrom a Base64String.- Parameters: None
-
Return:
Bitmap, the decoded image.
-
toBitmap(): Reads the file in file system path represented by theStringas 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:
Stringrepresentation of the date inyyyyMMddHHmmssformat.
-
Parameters: