Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Cordova
Classes | |
enum | CameraFacing |
enum | RecognitionMode |
enum | WorkingRange |
Public Member Functions | |
SymbologySettings | getSymbologySettings (Barcode.Symbology symbology) |
void | setSymbologyEnabled (int symbology, boolean enabled) |
void | setProperty (String key, Object value) |
Public Attributes | |
RecognitionMode | recognitionMode |
boolean | highDensityModeEnabled |
Rect | activeScanningAreaPortrait |
Rect | activeScanningAreaLandscape |
String | deviceName |
Boolean | matrixScanEnabled |
HashMap< Barcode.Symbology, SymbologySettings > | symbologies |
CameraFacing | cameraFacingPreference |
Point | scanningHotSpot |
number | relativeZoom |
int | maxNumberOfCodesPerFrame |
boolean | codeRejectionEnabled |
TextRecognitionSettings | textRecognition |
Working Range/Focus Control | |
int | workingRange |
Scan Session Configuration | |
int | codeCachingDuration |
int | codeDuplicateFilter |
Detailed Description
Settings to configure the decoding process.
Class Documentation
enum Scandit::ScanSettings::CameraFacing |
enum Scandit::ScanSettings::RecognitionMode |
enum Scandit::ScanSettings::WorkingRange |
The possible working ranges for the barcode picker.
- Since
- 4.11.0
Member Function Documentation
SymbologySettings getSymbologySettings | ( | Barcode.Symbology | symbology | ) |
Retrieve symbology specific-settings.
- Parameters
-
symbology the symbology settings to retrieve
- Returns
- the symbology settings object, or null, if symbology is an invalid symbology.
- Since
- 4.11.0
void setSymbologyEnabled | ( | int | symbology, |
boolean | enabled | ||
) |
Enable/disable decoding of a certain symbology.
This function provides a convenient shortcut to enabling/disabling decoding of a particular symbology without having to go through SymbologySettings.
Some 1d barcode symbologies allow you to encode variable-length data. By default, the Scandit BarcodeScanner SDK only scans barcodes in a certain length range. If your application requires scanning of one of these symbologies, and the length is falling outside the default range, you may need to adjust the SymbologySettings.activeSymbolCounts for this symbology. For details on defaults and how to calculate the symbol counts for each symbology, take a look at the barcode length page.
- Parameters
-
symbology The symbology to be enabled. enabled true when decoding of the symbology should be enabled, false if not.
- Since
- 4.11.0
void setProperty | ( | String | key, |
Object | value | ||
) |
Sets a property.
This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.
- Parameters
-
key The property's name. value The property's value.
Member Data Documentation
int workingRange |
The working range tells the engine at which distance barcodes are to be expected.
When set to {} (the default), the focus is optimized for barcodes close to the camera. When set to { WORKING_RANGE_LONG}, the focus is optimized for far-away codes. When using non-standard working range, it is better to directly pass the working range when constructing the barcode picker, because the camera can already start to adjust the focus at an earlier point in time.
The working range hint is ignored on cameras with fixed-focus.
int codeCachingDuration |
The duration (in milliseconds) for which barcodes are kept in the session.
When set to values larger than zero, the value is interpreted as milliseconds for which the barcodes should be kept in the session. If set to zero, barcodes are discarded before processing the next frame. Passing -1 will keep the codes for the duration of the scan session.
The default value is -1
int codeDuplicateFilter |
The duration of the duplicate filter in milliseconds.
When set to values larger than zero, barcodes with the same symbology and data are filtered out if they are decoded less than the specified milliseconds apart. Set this value to zero, if you do not want to filter duplicates. When set to -1, barcodes are filtered as duplicates if they match an already decoded barcode in the session.
By default, the duplicate filter is set to 500ms
- See also
- codeCachingDuration
RecognitionMode recognitionMode |
The recognition mode to use for the barcode picker.
Use this function to programmatically switch between text and barcode recognition. By default, barcode recognition is on (RecognitionMode.CODE).
boolean highDensityModeEnabled |
High density mode enables phones to work at higher camera resolution, provided they support it.
When enabled, phones that are able to run the video preview at 1080p (1920x1080) will use 1080p and not just 720p (1280x720). High density mode gives better decode ranges at the expense of processing speed and allows to decode smaller code in the near range, or codes that further away.
By default, high density mode is disabled.
Rect activeScanningAreaPortrait |
Sets the active scan area for portrait mode scanning.
By default, the barcode recognition engine searches the whole image for barcodes. Use this method to define the area in which barcodes are to be searched. Rectangle coordinates run from 0 to 1. The coordinates are relative to the whole camera preview frames and not the view in which the preview frames are displayed. When displaying the picker as a subview with an aspect ratio different from the camera image, it is generally a good idea to restrict the active scanning area to the visible part of the preview.
- Since
- 4.11.0
Invoking this method with invalid rectangles, e.g. rectangles whose x, y, width or height attributes are outside the allowed range of 0.0-1.0 will have no effect.
Rect activeScanningAreaLandscape |
Sets the active scan area for landscape mode scanning.
By default, the barcode recognition engine searches the whole image for barcodes. Use this method to define the area in which barcodes are to be searched. Rectangle coordinates run from 0 to 1. The coordinates are relative to the whole camera preview frames and not the view in which the preview frames are displayed. When displaying the picker as a subview with an aspect ratio different from the camera image, it is generally a good idea to restrict the active scanning area to the visible part of the preview.
- Since
- 4.11.0
Invoking this method with invalid rectangles, e.g. rectangles whose top, left, right, or bottom attributes are outside the allowed range of 0.0-1.0, or rectangles with negative width/height will have no effect.
String deviceName |
Sets the device name to identify the current device when looking at analytics tools.
Sends a request to the server to set this as soon as a connection is available.
- Parameters
-
deviceName A device name.
Boolean matrixScanEnabled |
Whether MatrixScan should be enabled.
MatrixScan allows you to show the locations of all localized codes. In order to get MatrixScan, it is recommended to implement the {didRecognizeNewCodes} callback and to use { MatrixScanSession#newlyTrackedCodes newlyTrackedCodes}. To use the default MatrixScan UI, it is necessary to set { ScanOverlay#setGuiStyle() setGuiStyle()} to { ScanOverlay.GuiStyle.MATRIX_SCAN Scandit.ScanOverlay.GuiStyle.MATRIX_SCAN}. Implementing a custom MatrixScan UI is not possible. enabled Whether MatrixScan should be enabled. 5.5.0
HashMap<Barcode.Symbology, SymbologySettings> symbologies |
Hash containing the symbology settings for each available symbology.
CameraFacing cameraFacingPreference |
The picker first gives preference to cameras of the specified direction.
When the device has no such camera, cameras of the opposite face are tried as well.
By default, the back-facing camera is preferred.
- Since
- 4.11.0
Point scanningHotSpot |
The location in the image where barcodes are decoded with the highest priority.
This variable shows a slightly different behavior depending on whether the full screen scanning is active or not. In Full screen scanning mode:
Sets the location in the image which is decoded with the highest priority when multiple barcodes are present in the image.
In restrictActiveScanningArea mode (activated with setting either {activeScanningAreaPortrait} or { ScanSettings.activeScanningAreaLandscape activeScanningAreaLandscape}): Changes the location of the spot where the barcode decoder actively scans for barcodes.
X and Y can be between 0 and 1, where 0/0 corresponds to the top left corner and 1/1 to the bottom right corner of the screen.
The default hotspot is centered on the image (0.5,0.5)
When setting the hot spot to values outside the allowed range, the hot spot value is ignored.
number relativeZoom |
The percentage of the max zoom (between 0 and 1).
int maxNumberOfCodesPerFrame |
Maximum number of codes to be decoded every frame.
The value is set to 1 if a negative value is supplied.
boolean codeRejectionEnabled |
Whether code rejection is enabled.
Property indicating whether code rejection is enabled. This feature allows you to implement custom integrity checks for recognized barcodes by rejecting codes that don't satisfy additional criteria. By default, code rejection is disabled.
- See also
- {} 4.15.0
TextRecognitionSettings textRecognition |
Settings to configure the text recognition.
Note that text recognition is not available in the default builds.