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

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.
ScanditLicense.setAppKey(sScanditSdkAppKey);
// 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);
Since
5.6.0

Member Function Documentation

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

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.

Parameters
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.
Returns
The newly constructed scan case instance.
Since
5.6.0
void didScan ( ScanSession  session)
inherited

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

Parameters
sessioncurrent scan session
See also
ScanSettings.setCodeDuplicateFilter
ScanSettings.setCodeCachingDuration
void didProcess ( byte[]  imageBuffer,
int  width,
int  height,
ScanSession  session 
)
inherited

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.

Parameters
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.
Since
4.9.0

Implemented in MatrixScan.

Member Data Documentation

final int STATE_OFF
static

Camera is off, torch is off.

final int STATE_STANDBY
static

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

final int STATE_ACTIVE
static

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

final int MODE_FACE_FORWARD
static

Forward scanning mode (default).

final int MODE_FACE_DOWNWARD
static

Regular scanning mode, can be used without the case.


The documentation for this class was generated from the following file:
  • ScanCase.java