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 Android
Public Member Functions | |
void | setWorkingRange (ScanditSDK.WorkingRange range) |
ScanditSDK.WorkingRange | getWorkingRange () |
boolean | isSymbologyEnabled (ScanditSDK.Symbology symbology) |
void | enableSymbology (ScanditSDK.Symbology symbology) |
Set< ScanditSDK.Symbology > | getEnabledSymbologies () |
void | enableColorInverted2dRecognition (boolean enabled) |
boolean | isColorInverted2dRecognitionEnabled () |
void | setChecksumForSymbology (ScanditSDK.Symbology symbology, int checksum) |
int | getChecksumForSymbology (ScanditSDK.Symbology symbology) |
int | getMsiPlesseyChecksumType () |
void | setMsiPlesseyChecksumType (int checksumType) |
void | enableMicroDataMatrix (boolean enabled) |
boolean | isMicroDataMatrixEnabled () |
void | setCodeCachingDuration (int duration) |
int | getCodeCachingDuration () |
void | setCodeDuplicateFilter (int duration) |
int | getCodeDuplicateFilter () |
boolean | is2dRecognitionForced () |
void | force2dRecognition (boolean enable) |
void | enableHighDensityMode (boolean enable) |
boolean | isHighDensityModeEnabled () |
void | enableRestrictedAreaScanning (boolean enable) |
boolean | isRestrictedAreaScanningEnabled () |
void | setScanningHotSpotHeight (float height) |
float | getScanningHotSpotHeight () |
void | setActiveScanningArea (int orientation, RectF rect) |
RectF | getActiveScanningArea (int orientation) |
void | setMaxNumCodesPerFrame (int num) |
int | getMaxNumCodesPerFrame () |
void | setDeviceName (String deviceName) |
String | getDeviceName () |
JSONObject | toJSON () throws JSONException |
int | getCameraFacingPreference () |
void | setCameraFacingPreference (int preference) |
void | setScanningHotSpot (float x, float y) |
PointF | getScanningHotSpot () |
void | setRelativeZoom (float zoomPercentage) |
float | getRelativeZoom () |
Static Public Member Functions | |
static ScanditSDKScanSettings | getPre43DefaultSettings () |
static ScanditSDKScanSettings | getDefaultSettings () |
Detailed Description
Holds settings that affect the recognition of barcodes, such as enabled barcode symbologies, scanning hot spot etc.
The ScanditSDKScanSettings class was introduced in Scandit BarcodeScanner SDK 4.3 to hold all scan-specific settings. The settings are passed to the ScanditSDKBarcodePicker when it is constructed.
- Since
- 4.3.0
Member Function Documentation
void setWorkingRange | ( | ScanditSDK.WorkingRange | range | ) |
Sets 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 ScanditSDK.WorkingRange.STANDARD_RANGE (the default), the focus is optimized for barcodes close to the camera. When set to ScanditSDK.WorkingRange.LONG_RANGE, 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.
- Parameters
-
range the working range
ScanditSDK.WorkingRange getWorkingRange | ( | ) |
- Returns
- the preferred working range
boolean isSymbologyEnabled | ( | ScanditSDK.Symbology | symbology | ) |
Determine whether the given symbology is enabled or not.
- Parameters
-
symbology the symbology to check for
- Returns
- true when the given symbology is enabled, false otherwise
void enableSymbology | ( | ScanditSDK.Symbology | symbology | ) |
Enable recognition of given symbology.
By default, all symbologies are turned off and symbologies need to be explicitly enabled.
- Parameters
-
symbology symbology to enable
Set<ScanditSDK.Symbology> getEnabledSymbologies | ( | ) |
- Returns
- list of enabled symbologies
|
static |
Convenience method to retrieve default settings as they were before ScanditSDK 4.3.
This method will return a settings object with symbologies on that were on by default for ScanditSDK 4.2 and older. These symbologies include EAN13, UPC12, EAN8, UPCE, CODE39, ITF, CODE128,QR, DATAMATRIX.
The use of this method is discouraged. Use getDefaultSettings instead and explicitly enable the symbologies that are required by your app.
- Returns
- new settings object
|
static |
Settings object with default values.
- Returns
- new settings object
void enableColorInverted2dRecognition | ( | boolean | enabled | ) |
Enables the detection of white on black codes.
This option currently only works for Data Matrix and QR codes.
By default this mode is disabled.
- Parameters
-
enabled Whether this mode should be enabled.
boolean isColorInverted2dRecognitionEnabled | ( | ) |
enableColorInverted2dRecognition
- Returns
- whether color-inverted 2D recognition is enabled
void setChecksumForSymbology | ( | ScanditSDK.Symbology | symbology, |
int | checksum | ||
) |
Set the optional checksum for a particular symbology.
Some barcode symbologies, e.g. ITF (Interleaved 2 of 5, MSI Plessey) support optional checksums. These checksums are evaluated when a code has been successfully decoded. In case the checksum matches, the code is returned, in case the checksum does not match, the code is rejected. Use this method to specify what checksum you want to use for symbologies that support optional checksums. At the moment, the following optional checksums can be set (default in bold):
- ITF: ScanditSDK.CHECKSUM_MOD_10, ScanditSDK.CHECKSUM_NONE
- MSI Plessey: ScanditSDK.CHECKSUM_NONE, ScanditSDK.CHECKSUM_MOD_10, ScanditSDK.CHECKSUM_MOD_11, ScanditSDK.CHECKSUM_MOD_1010, ScanditSDK.CHECKSUM_MOD_1110
Values other than those listed above will be ignored.
- Parameters
-
symbology the symbology to set the checksum on checksum the checksum to use.
int getChecksumForSymbology | ( | ScanditSDK.Symbology | symbology | ) |
Get the current optional checksum for a particular symbology.
- See also
- setChecksumForSymbology
- Parameters
-
symbology the symbology to retrieve the checksum for.
- Returns
- the current active checksum, or ScanditSDK.CHECKSUM_NONE in case no additional checksum is defined.
int getMsiPlesseyChecksumType | ( | ) |
- Returns
- the active MSI plessey checksum type
void setMsiPlesseyChecksumType | ( | int | checksumType | ) |
Sets the type of checksum that is expected of the MSI Plessey codes.
MSI Plessey is used with different checksums. Set the checksum your application uses with this method.
By default it is set to CHECKSUM_MOD_10.
- Parameters
-
checksumType The MSIPlesseyChecksumType your application uses.
void enableMicroDataMatrix | ( | boolean | enabled | ) |
Enable the detection/decoding of tiny Data Matrix codes.
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.
- Parameters
-
enabled Whether this mode should be enabled.
boolean isMicroDataMatrixEnabled | ( | ) |
- Returns
- whether micro data matrix mode is enabled
void setCodeCachingDuration | ( | int | duration | ) |
Sets the duration (in milliseconds) for which barcodes are kept in the session.
By default, codes are kept for the duration of the session.
- Parameters
-
duration 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 getCodeCachingDuration | ( | ) |
- Returns
- the code caching duration in milliseconds
void setCodeDuplicateFilter | ( | int | duration | ) |
Set the code duplicate filter to the given duration in milliseconds.
- Parameters
-
duration 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 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
- setCodeCachingDuration(int)
int getCodeDuplicateFilter | ( | ) |
- Returns
- the code duplicate filter in milliseconds
boolean is2dRecognitionForced | ( | ) |
- Returns
- true when 2d recognition is forced, false if not
void force2dRecognition | ( | boolean | enable | ) |
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.
- Parameters
-
enable
- See also
- enableMicroDataMatrix(boolean)
void enableHighDensityMode | ( | boolean | enable | ) |
Turn on/off high density mode.
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.
- Parameters
-
enable whether high density mode should be enabled
boolean isHighDensityModeEnabled | ( | ) |
- Returns
- true when high density mode is enabled, false if not
void enableRestrictedAreaScanning | ( | boolean | enable | ) |
Reduces the area in which barcodes are detected and decoded.
When activated, the active scanning area is defined by setScanningHotSpotHeight(float), setScanningHotSpot(float, float) and setActiveScanningArea(int, RectF)
- Parameters
-
enable when true enables active area scanning, when false, disables active area scanning.
boolean isRestrictedAreaScanningEnabled | ( | ) |
- Returns
- whether restricted active area scanning is enabled
void setScanningHotSpotHeight | ( | float | height | ) |
Changes the height of the area where barcodes are decoded in the camera image when restrictActiveScanningArea is activated.
The height of the active scanning area is relative to the height of the screen 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
- enableRestrictedAreaScanning(boolean)
- setScanningHotSpot(float, float)
- Parameters
-
height The relative height of the active scanning area.
float getScanningHotSpotHeight | ( | ) |
- Returns
- the relative height of the active area.
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 image 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 (enableRestrictedAreaScanning(boolean)).
- Since
- 4.4.0
- Parameters
-
orientation the device orientation for which to set the scan area. Must be either ScanditSDK#ORIENTATION_LANDSCAPE for landscape orientations (landscape-right and landscape-left), or ScanditSDK#ORIENTATION_PORTRAIT for portrait orientations.
Calling this method with other orientation parameters is a no-op.
- Parameters
-
rect the 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.
- Since
- 4.4.0
- Parameters
-
orientation the device orientation. Must either be ScanditSDK#ORIENTATION_LANDSCAPE, or ScanditSDK#ORIENTATION_PORTRAIT
- Returns
- 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
- setActiveScanningArea
void setMaxNumCodesPerFrame | ( | int | num | ) |
Set the maximum number of codes to be decoded per frame.
By default at most one code is decoded per frame. Use this method to enable scanning multiple codes per frame.
- Since
- 4.5.0
- Parameters
-
num the new maximum number of codes to be decoded per frame. Values are clamped to the range 1...6.
int getMaxNumCodesPerFrame | ( | ) |
- Returns
- the maximum number of frames to be coded every frame
- Since
- 4.5.0
- See also
- setMaxNumCodesPerFrame
void setDeviceName | ( | 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.
String getDeviceName | ( | ) |
Returns the device name identifying the current device.
- Returns
- The device name.
JSONObject toJSON | ( | ) | throws JSONException |
- Returns
- 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.
- Since
- 4.4.0
int getCameraFacingPreference | ( | ) |
- Returns
- ScanditSDK.CAMERA_FACING_BACK when the back-facing camera should be preferred, ScanditSDK.CAMERA_FACING_FRONT when the front-facing camera should be preferred.
- Since
- 4.3.0
void setCameraFacingPreference | ( | int | preference | ) |
Set 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.
- Parameters
-
preference ScanditSDK.CAMERA_FACING_BACK when the back-facing camera should be preferred, ScanditSDK.CAMERA_FACING_FRONT when the front-facing camera should be preferred.
- Since
- 4.3.0
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 enableRestrictedAreaScanning(boolean)):
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)
- Parameters
-
x The hotspot's relative x coordinate. y The hotspot's relative y coordinate.
PointF getScanningHotSpot | ( | ) |
- Returns
- the scanning hot spot
void setRelativeZoom | ( | float | zoomPercentage | ) |
Sets the zoom to the given percentage of the max zoom possible.
- Parameters
-
zoomPercentage The percentage of the max zoom (between 0 and 1).
float getRelativeZoom | ( | ) |
- Returns
- the relative zoom
The documentation for this class was generated from the following file:
- ScanditSDKScanSettings.java