Public Member Functions

void SetActiveScanningArea (int orientation, RectF rect)
RectF GetActiveScanningArea (int orientation)
JSONObject ToJSON () throws JSONException
SymbologySettings GetSymbologySettings (int symbology)
int GetProperty (String key)
void SetProperty (String key, Object value)
void SetSymbologyEnabled (int symbology, bool enabled)
bool IsSymbologyEnabled (int symbology)
int CameraFacingPreference ()
void SetScanningHotSpot (float x, float y)

Static Public Member Functions

static ScanSettings Create ()

Public Attributes

bool MicroDataMatrixEnabled
bool Force2dRecognitionEnabled
bool HighDensityModeEnabled
bool RestrictedAreaScanningEnabled
float ScanningHotSpotHeight
String DeviceName
int CameraFacingPreference
readonly PointF ScanningHotSpot
float RelativeZoom
int MaxNumberOfCodesPerFrame
Recognition Mode
const int RecognitionModeText
const int RecognitionModeCode
const int RecognitionModeCodeAndText
Focus Working Range
const int WorkingRangeStandard
const int WorkingRangeLong
Camera Facing Direction
const int CameraFacingBack
const int CameraFacingFront
Display Orientation
const int OrientationLandscape
const int OrientationPortrait
Working Range/Focus Control
int WorkingRange
Scan Session Configuration
int CodeCachingDuration
int CodeDuplicateFilter


bool CodeRejectionEnabled [get, set]
TextRecognitionSettings TextRecognitionSettings [get, set]
int RecognitionMode [get, set]
bool MatrixScanEnabled [get, set]

Detailed Description

Holds settings that affect the recognition of barcodes, such as enabled barcode symbologies, scanning hot spot etc.


Member Function Documentation

void SetActiveScanningArea ( int  orientation,
RectF  rect 

Sets the active scan area for either portrait or landscape mode scanning.

By default, the barcode recognition engine searches the whole camera preview for barcodes. Use this method to define the area in which barcodes are to be searched. Rectangle coordinates run from 0 to 1.

Calling this method will automatically enable restricted active area scanning (RestrictedAreaScanningEnabled).

orientationthe device orientation for which to set the scan area. Must be either OrientationLandscape for landscape orientations (landscape-right and landscape-left), or OrientationPortrait for portrait orientations.

Calling this method with other orientation parameters is a no-op.

rectthe new active scan area. The coordinates (top, left, right, bottom) are defined as seen by the user.

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.

RectF GetActiveScanningArea ( int  orientation)

Returns the scan area that is going to be used for the given orientation.

orientationthe device orientation. Must either be OrientationLandscape, or OrientationPortrait
The rectangle, or null when orientation is not one of the allowed values. When restricted area scanning is disabled a full-screen area (top=0, left=0, right=1, bottom=1) is returned, otherwise the area from either specifying the scanning hotspot/height or calls to SetActiveScanningArea is returned.
See also
JSONObject ToJSON ( ) throws JSONException
the settings as a json dictionary

There is no guarantee that the JSON dictionary is stable, keys might disappear, be added or renamed without notice.

static ScanSettings Create ( )
the default scan settings
SymbologySettings GetSymbologySettings ( int  symbology)

Retrieve symbology specific-settings.

symbologythe symbology settings to retrieve
the symbology settings object, or null, if symbology is an invalid symbology.
int GetProperty ( String  key)

Get custom propery value.

keythe name of the property
the value of the property. For properties have not previously been set on the settings object -1 is returned.
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.

keyThe property's name.
valueThe property's value.
void SetSymbologyEnabled ( int  symbology,
bool  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.

symbologyThe symbology to be enabled.
enabledtrue when decoding of the symbology should be enabled, false if not.
bool IsSymbologyEnabled ( int  symbology)

Determine whether decoding of a particular symbology is enabled or not.

symbologyThe symbology
true when decoding of the symbology is enabled, false if not.
int CameraFacingPreference ( )


CameraFacingBack when the back-facing camera should be preferred, CameraFacingFront when the front-facing camera should be preferred.
void SetScanningHotSpot ( float  x,
float  y 

Sets the location in the image where barcodes are decoded with the highest priority.

This method 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 RestrictedAreaScanningEnabled):

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.

The default hotspot is centered on the image (0.5,0.5)

xThe hotspot's relative x coordinate.
yThe hotspot's relative y coordinate.

Member Data Documentation

const int RecognitionModeText

Text recognition.

const int RecognitionModeCode

Barcode/2d code recognition.

const int RecognitionModeCodeAndText

Both text recognition and barcode/2d code recognition are enabled.

const int WorkingRangeStandard

Standard working range.

const int WorkingRangeLong

Long-distance working range.

const int CameraFacingBack

Default camera orientation - facing away from user.

const int CameraFacingFront

Camera facing towards user.

const int OrientationLandscape

Orientation is either landscape or landscapeReverse.

const int OrientationPortrait

Orientation is either portrait or portraitUpsideDown.

bool MicroDataMatrixEnabled

Whether the detection/decoding of tiny Data Matrix codes is enabled.

When this mode is enabled, a dedicated localization algorithm is activated that searches for small Datamatrix codes in the central part of the camera image. This algorithm requires additional resources and slows down the recognition of other barcode symbologies. We recommend using the method only when your application requires the decoding of tiny Datamatrix codes.

By default this mode is disabled.

int WorkingRange

The focus working range for the barcode picker.

The working range tells the engine at which distance barcodes are to be expected. When set to WorkingRangeStandard (the default), the focus is optimized for barcodes close to the camera. When set to WorkingRangeLong, 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.

By default, codes are kept for the duration of 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

Set the code duplicate filter to the given duration 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 duration 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
bool Force2dRecognitionEnabled

Forces the barcode scanner to always run the 2D decoders (QR, Datamatrix, etc.), even when the 2D detector did not detect the presence of a 2D code.

This slows down the overall scanning speed, but can be useful when your application only tries to read 2D codes. Force 2d recognition is set to on when micro data matrix mode is enabled.

By default, forced 2d recognition is disabled.

See also
bool 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.

bool RestrictedAreaScanningEnabled

Reduces the area in which barcodes are detected and decoded.

When activated, the active scanning area is defined by ScanningHotSpotHeight, SetScanningHotSpot(float, float) and SetActiveScanningArea(int, RectF)

float ScanningHotSpotHeight

Changes the height of the area where barcodes are decoded in the camera preview when restrictActiveScanningArea is activated.

The height of the active scanning area is relative to the height of the camera preview and has to be between 0.0 and 0.5.

This only applies if the active scanning area is restricted.

The default is 0.25

As of Scandit BarcodeScanner SDK 4.4, the use of this method is discouraged. Use SetActiveScanningArea instead.

See also
SetScanningHotSpot(float, float)
String DeviceName

A 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.

int CameraFacingPreference

The preferred camera direction.

The picker first gives preference to cameras of the given 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.

readonly PointF ScanningHotSpot


the scanning hot spot
float RelativeZoom

Sets the zoom to the given percentage of the max zoom possible (between 0 and 1).

int MaxNumberOfCodesPerFrame

The maximum number of codes to be decoded every frame.

If set to values smaller than 1, a minimum of 1 code per frame is enforced.

Property Documentation

bool CodeRejectionEnabled

Whether code rejection is enabled.

Code rejection allows you to implement custom validation logic for codes in the DidScan event. By default, code rejection is disabled.


Text recognition settings.

Note that text recognition is not available in the default builds.

int RecognitionMode

The recognition mode to use for the barcode picker.

Use this to switch between text and barcode recognition. By default, barcode recognition is on (RecognitionModeCode).

bool MatrixScanEnabled

Whether MatrixScan should be enabled.

MatrixScan allows you to know the location of all localized codes. In order to get MatrixScan, it is recommended to implement the ProcessFrameDelegate interface and to use ScanSession::getTrackedCodes(). To use the default MatrixScan UI, it is necessary to set ScanOverlay::setGuiStyle(int) to ScanOverlay::GUI_STYLE_MATRIX_SCAN. When implementing a custom MatrixScan UI, it is recommended to set ScanOverlay::setGuiStyle(int) to ScanOverlay::GUI_STYLE_NONE.

enabledWhether MatrixScan should be enabled.