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

ScanCaseSession Interface Reference

Public Member Functions

List< BarcodegetNewlyRecognizedCodes ()
 
List< BarcodegetNewlyLocalizedCodes ()
 
List< BarcodegetAllRecognizedCodes ()
 
Map< Long, TrackedBarcodegetTrackedCodes ()
 
void rejectCode (Barcode code)
 
void rejectTrackedCode (TrackedBarcode trackedCode)
 
void clear ()
 

Detailed Description

Holds all barcodes that were decoded in the current session.

Configuring Session Behavior

The scan case session is responsible for determining the list of "relevant" barcodes by filtering out duplicates. Depending on your app, different duplicate removal is required. For some applications, only one barcode is required. The scanning process is stopped as soon as one code is decoded. For other applications, multiple codes are scanned after another. For example, a scanner at the cash desk may need to scan multiple products. To avoid duplicates, the same barcode should not be scanned in short succession. The same barcode (data, symbology) should not count as a duplicate if encountered again after a few seconds.

By default, if a barcode has the same symbology and data as code that was decoded less than 1000ms ago, it is filtered out as a duplicate.

Session Lifetime

The session is cleared when ScanCase state changes from ScanCase.STATE_OFF to ScanCase.STATE_ACTIVE, or when the user manually clears the session using ScanCaseSession.clear().

Since
5.6.0

Member Function Documentation

List<Barcode> getNewlyRecognizedCodes ( )

A new copy of the list of barcodes that have been successfully decoded (recognized) in the last frame.

Returns
a new copy of the list of barcodes that have been successfully recognized in the last frame
Since
5.6.0
List<Barcode> getNewlyLocalizedCodes ( )

A new copy of the list of barcodes that have been localized but not recognized in the last frame.

Returns
a new copy of the list of barcodes that have been localized but not recognized in the last frame
Since
5.6.0
List<Barcode> getAllRecognizedCodes ( )

Returns the list of barcodes (data, symbology) that have been decoded (recognized) in this session.

Depending on the code caching and duplicate filtering behavior, different sets of codes are returned by this method.

Returns
a new copy of the list of barcodes that have been successfully decoded in this session
Since
5.6.0
Map<Long, TrackedBarcode> getTrackedCodes ( )

Returns a map between tracked object identifiers and tracked objects.

To toggle tracking use ScanCaseSettings.setMatrixScanEnabled().

Warning
It will return null when tracking is disabled.
This property is meant to be used only in the session thread.
Returns
a new copy of the dictionary of tracked objects that have been successfully tracked in the last frame.
Since
5.7.0
void rejectCode ( Barcode  code)

Prevent beeping/vibrating and highlighting for a particular code.

Use this method to reject a certain code if you have additional methods for verifying the integrity of the code, e.g. with a custom checksum. Rejected codes won't be highlighted in the scan UI. Additionally beep and vibration will be suppressed.

For code rejection to work, you must enable it by setting code rejection to true.

Rejected codes will be added to getAllRecognizedCodes() like all other codes.

Note that you should only pass codes returned by getNewlyRecognizedCodes() as passing any other code will have no effect. Additionally, you should only calls this method from ScanCaseListener.didScan()

Parameters
codeThe code to reject
Exceptions
IllegalStateExceptionIf it is called outside of ScanCaseListener.didScan().
Since
5.7.0
void rejectTrackedCode ( TrackedBarcode  trackedCode)

The code that should be visualized as rejected in the tracking view.

Use this method to visually reject a certain code in the tracking API. In order to use this feature it is necessary to enable ScanCaseSettings.setMatrixScanEnabled() and set ScanOverlay.setGuiStyle() to ScanOverlay.GUI_STYLE_MATRIX_SCAN.

Warning
This property is meant to be used only in the session thread. Additionally, you should only call this method from ScanCaseListener.didProcess()
Parameters
trackedCodeThe tracked code to visually reject
Exceptions
IllegalStateExceptionIf it is called outside of ScanCaseListener.didProcess().
Since
5.7.0
void clear ( )

Remove all codes from the scan session.

Use this method to manually remove all codes from the scan session. Typically you will not have to call this method directly but instead configure the duplicate removal and code caching duration with through ScanSettings

Since
5.6.0

The documentation for this interface was generated from the following file:
  • ScanCaseSession.java