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 React Native

Scandit.ScanSettings Class Reference


enum  CameraFacing
enum  RecognitionMode
enum  WorkingRange

Public Member Functions

SymbologySettings getSymbologySettings (Barcode.Symbology symbology)
void setSymbologyEnabled (int symbology, boolean enabled)

Public Attributes

RecognitionMode recognitionMode
boolean highDensityModeEnabled
String deviceName
HashMap< Barcode.Symbology, SymbologySettingssymbologies
CameraFacing cameraFacingPreference
number relativeZoom
int maxNumberOfCodesPerFrame
boolean codeRejectionEnabled
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

Camera facing direction.

Class Members
BACK Facing away from the user.
FRONT Facing towards the user (Facetime camera).
enum Scandit::ScanSettings::RecognitionMode

Possible recognition modes.

Class Members
TEXT Text recognition.
CODE Barcode/2d code recognition.
enum Scandit::ScanSettings::WorkingRange

Possible working ranges for the barcode picker.

Class Members
STANDARD The camera tries to focus on barcodes which are close to the camera.

To scan far- away codes (30-40cm+), user must tap the screen. This is the default working range and works best for most use-cases. Only change the default value if you expect the users to often scan codes which are far away.

LONG The camera tries to focus on barcodes which are far from the camera.

This will make it easier to scan codes that are far away but degrade performance for very close codes.

Member Function Documentation

SymbologySettings getSymbologySettings ( Barcode.Symbology  symbology)

Retrieve symbology specific-settings.

symbologythe symbology settings to retrieve
the symbology settings object, or null, if symbology is an invalid symbology.
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.

symbologyThe symbology to be enabled.
enabledtrue when decoding of the symbology should be enabled, false if not.

Member Data Documentation

int workingRange

The working range tells the engine at which distance barcodes are to be expected.

When set to WorkingRange.WORKING_RANGE_STANDARD (the default), the focus is optimized for barcodes close to the camera. When set to WorkingRange.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

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.

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.

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.

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