Barcode Tracking Session

Defined in package com.scandit.datacapture.barcode.tracking.capture

BarcodeTrackingSession
class BarcodeTrackingSession

Added in version 6.0.0

The tracking session contains all the currently tracked barcodes and changes that were made specifically in the last processed frame.

Important

The tracking session should only be accessed from within onSessionUpdated() to which it is provided as an argument. It is not safe to be accessed from anywhere else since it may be concurrently modified.

Specifically no reference to trackedBarcodes, addedTrackedBarcodes, removedTrackedBarcodes or updatedTrackedBarcodes should be kept and traversed outside of onSessionUpdated(). Instead a copy of the lists should be made to avoid concurrent modification. The individual tracked barcodes can be referenced without copying as they are not further modified.

addedTrackedBarcodes
@NonNull List<@NonNull TrackedBarcode> getAddedTrackedBarcodes()

Added in version 6.0.0

Newly tracked barcodes.

unscannedTrackedBarcodes
@NonNull List<@NonNull TrackedBarcode> getUnscannedTrackedBarcodes()

Added in version 6.14.0

Barcodes that could not be scanned.

removedTrackedBarcodes
@NonNull List<@NonNull Integer> getRemovedTrackedBarcodes()

Added in version 6.0.0

The identifiers of lost tracked barcodes that were removed.

updatedTrackedBarcodes
@NonNull List<@NonNull TrackedBarcode> getUpdatedTrackedBarcodes()

Added in version 6.0.0

Updated tracked barcodes (new location).

trackedBarcodes
@NonNull Map<@NonNull Integer, @NonNull TrackedBarcode> getTrackedBarcodes()

Added in version 6.0.0

A map from identifiers to tracked barcodes. It contains all currently tracked barcodes.

frameSequenceId
long getFrameSequenceId()

Added in version 6.1.0

The identifier of the current frame sequence.

Important

As long as there is no interruptions of frames coming from the camera, the frameSequenceId will stay the same.

toJson()
@NonNull String toJson()

Added in version 6.2.0

Returns the JSON representation of the barcode tracking session.

reset()
void reset()

Added in version 6.11.0

Resets the barcode tracking session, effectively clearing the history of tracked barcodes. This function should only be called inside the listeners’ callback.