Inherits OnScanListener, and ProcessFrameListener.

Public Member Functions

void didScan (ScanSession session)
void didProcess (byte[] imageBuffer, int width, int height, ScanSession session)

Static Public Member Functions

static ScanCase acquire (Context context, ScanCaseSettings settings, ScanCaseListener listener)

Static Public Attributes

Possible states of the scan case.
static final int STATE_OFF
static final int STATE_STANDBY
static final int STATE_ACTIVE
Possible modes of the scan case.
static final int MODE_FACE_FORWARD
static final int MODE_FACE_DOWNWARD

Detailed Description

Start a scanner for the Scandit case.

Example (minimal) usage:

// Set your app key on the license first.
// Create the settings used for the scan case.
ScanCaseSettings scanCaseSettings = ScanCaseSettings();
// Enable symbologies etc.
scanCaseSettings.setSymbology(Barcode.SYMBOLOGY_EAN13, true);
// Instantiate the scan case.
ScanCase scanCase = ScanCase.acquire(context, scanSettings, this);

Member Function Documentation

static ScanCase acquire ( Context  context,
ScanCaseSettings  settings,
ScanCaseListener  listener 

Initializes a new scan case.

Note that the initial invocation of this method will activate the Scandit Barcode Scanner SDK, after which the device will count towards your device limit.

Make sure to set the app key available from your Scandit account through ScanditLicense.setAppKey before you call this initializer.

This is the recommended way to create a new ScanCase object.

contextThe context we are operating in.
settingsThe scan settings to use. You may pass null, which is identical to passing a default settings instance constructed through the parameterless constructor.
listenerThe scan case listener.
The newly constructed scan case instance.
void didScan ( ScanSession  session)

Called whenever a new barcode has been successfully recognized.

Newly recognized codes are available as ScanSession.getNewlyRecognizedCodes(). When didScan callback is invoked, there is always at least one new code available.

The callback is invoked in the thread running the barcode recognition engine. This means, any change to the graphical user interface will have to be moved to the UI thread. Likewise, Since the callback blocks the engine, any expensive calculation should be posted to a Handler.

When no more codes should be scanned, call ScanSession.stopScanning, when the scan session should be paused, call ScanSession.pauseScanning. Calling these two methods is preferred over calling BarcodePicker.stopScanning and BarcodePicker.pauseScanning, as it will immediately stop/pause the scanning.

Note, it is only safe to access the session object inside the didScan callback, but you can safely store the lists of barcodes returned by ScanSession.getAllRecognizedCodes and ScanSession.getNewlyRecognizedCodes

sessioncurrent scan session
See also
void didProcess ( byte[]  imageBuffer,
int  width,
int  height,
ScanSession  session 

Invoked every time a frame has been processed by the barcode recognition engine.

In contrast to com.scandit.barcodepicker.OnScanListener.didScan, the didProcess callback is invoked after every frame, regardless whether a code could be successfully decoded or not. If your are only interested in fully decoded codes, use the com.scandit.barcodepicker.OnScanListener instead.

The didProcess callback is invoked in the thread that runs the recognition engine and blocks further processing. In case codes have been recognized in the same frame, the ProcessFrameListener.didProcess callback is invoked after com.scandit.barcodepicker.OnScanListener.didScan.

imageBufferthe raw image data that was processed in NV21 format
widthwidth of the image buffer in pixels
heightheight of the image buffer in pixels
sessioncontains information on the current recognition process. It is only valid to access the scan session from within the callback. If part of the information is required outside the callback it must be copied first.

Implemented in MatrixScan.

Member Data Documentation

final int STATE_OFF

Camera is off, torch is off.


Camera is on, scanner is off, torch is off.

final int STATE_ACTIVE

Camera is on, scanner is on, torch is on.


Forward scanning mode (default).


Regular scanning mode, can be used without the case.

The documentation for this class was generated from the following file: