Consists of the barcode scanner object.
The barcode scanning process is started by calling the scan
method below. A full-screen live camera preview is displayed, with a rectangular scanning
area. The barcode scanner continuously analyses the scanning area until it detects a valid
barcode or the scan is cancelled. The preview screen is automatically closed when a barcode is
successfully read or the scan is cancelled.
Use the launchbox.BarcodeScanner
reference to obtain an instance of this
object.
The values below are used by the scanMode
setting of the
scan
method.
Name | Description |
---|---|
SCAN_MODE_ALL | The scanner will attempt to detect all supported barcode types. This is the default mode. |
SCAN_MODE_PRODUCT | The scanner will attempt to detect all product type barcodes. The supported barcode formats are: FORMAT_UPC_A, FORMAT_UPC_E, FORMAT_EAN_8, FORMAT_EAN_13. |
SCAN_MODE_1D | The scanner will attempt to detect all one dimensional (1D) type barcodes. The supported barcode formats are: FORMAT_UPC_A, FORMAT_UPC_E, FORMAT_EAN_8, FORMAT_EAN_13, FORMAT_CODE_39, FORMAT_CODE_128, FORMAT_ITF. |
SCAN_MODE_QR_CODE | The scanner will attempt to detect QR CODE type barcodes. The supported barcode format is: FORMAT_QR_CODE. |
SCAN_MODE_DATA_MATRIX | The scanner will attempt to detect DATA MATRIX type barcodes. The supported barcode format is: FORMAT_DATA_MATRIX. |
The following values are supported on iOS devices only: FORMAT_CODE_93, FORMAT_AZTEC, FORMAT_CODEBAR, FORMAT_RSS14, FORMAT_RSS_EXPANDED, FORMAT_UPC_EAN_EXTENSION.
The values below are used by the characterSet
setting of the
scan
method.
Name | Description |
---|---|
ENCODING_SHIFT_JIS | The scanner will attempt to decode barcode data using the Shift-JIS encoding. |
ENCODING_UTF_8 | The scanner will attempt to decode barcode data using the UTF-8 encoding. |
ENCODING_ISO_8859_1 | The scanner will attempt to decode barcode data using the ISO-8859-1 encoding. |
The table below lists barcode int
values returned by the
onSuccess
callback method.
Value | Description |
---|---|
-1 | Unknown barcode format |
0 | QR Code 2D |
1 | Data Matrix 2D |
2 | UPC-E 1D |
3 | UPC-A 1D |
4 | EAN-8 1D |
5 | EAN-13 1D |
6 | Code 128 1D |
7 | Code 39 1D |
8 | ITF 1D |
9 | PDF417 |
10 | CODE_93 1D |
11 | AZTEC 2D |
12 | CODEBAR 1D |
13 | RSS14 |
14 | RSS_EXPANDED |
15 | UPC_EAN_EXTENSION |
One of the following constants is passed in the error
object passed to the onFailure
callback
method to define the type of authentication failure.
Name | Description |
---|---|
INTERNAL_ERROR | Denotes that an internal error has occurred.. |
SCANNER_ERROR | Denotes that the scanning operation has failed due to a scanner-related error. |
Name | Description | Return type |
---|---|---|
scan | Launches the barcode scanning process and displays the full-screen live camera preview. |
undefined |