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 NativeHandle.

Public Member Functions

static RecognitionContext create (Context context, String licenseKey, File workingDirectory, String deviceName)
 
void startNewFrameSequence ()
 
void endFrameSequence ()
 
void setGeographicalLocation (float latitude, float longitude)
 
void processFrame (ImageDescription imageDescription, byte[] data) throws ContextStatusException
 
void processFrame (Image frame)
 

Static Public Attributes

static final String VERSION
 

Detailed Description

Manages scanner objects and schedules the recognition process.

The recognition context manages scanner objects of different types and takes care of scheduling the recognition process. By default, the recognition context does not have any scanners. To recognize a particular set of objects, the scanner object must be created. At the moment, the only available scanner is the BarcodeScanner which recognizes 1d and 2d codes in images.

To create a new recognition context, call RecognitionContext.create().

Member Function Documentation

static RecognitionContext create ( Context  context,
String  licenseKey,
File  workingDirectory,
String  deviceName 
)

Create a new recognition context.

Parameters
contextThe context where this recognition context should be created.
licenseKeyYour license key, can't be null.
workingDirectoryPath to a writable folder for storing temporary data, e.g. Context.getFilesDir().
deviceNameOptional descriptive device name. Can be any string to track individual physical devices in Scanalytics. This parameter can be NULL to disable tracking.

For performance reasons it is recommended that only one context per application is used. If multiple contexts are created, make sure that context with different model names (Build.MODEL) do not share the same workingDirectory.

Returns
The newly created recognition context.
Since
4.6.0
void startNewFrameSequence ( )

Start processing a new batch of continuous frames.

Call this function to inform the recognition context that a new sequence of frames starts. The recognition context can assume that frames passed to processFrame() have temporal consistency and can use it to optimize the recognition processs. To indicate discontinuities between frames, e.g. when resuming the camera after a pause, use endFrameSequence() followed by startNewFrameSequence().

This function must be called once before processFrame().

Since
4.7.0
void endFrameSequence ( )

Signal that a batch of continuous frames ended.

Use this function to indicate the end of a group of continuous frames. This function will automatically be called when the recognition context is deallocated.

Since
4.7.0
void setGeographicalLocation ( float  latitude,
float  longitude 
)

Set the geographical location.

Set the location at which the device currently is according to its location services. This is optional information, which, when provided, is transmitted to Scanalytics.

Parameters
latitudethe latitude (north) in WGS84 coordinates.
longitudethe longitude (east) in WGS84 coordinates.

The coordinate for Zurich, Switzerland would be 47.366667, 8.55.

Since
4.7.0
void processFrame ( ImageDescription  imageDescription,
byte[]  data 
) throws ContextStatusException

Process image frame with this recognition context.

The image is processed by the scanners associated with this context. The results, for example the recognized barcodes, can be accessed directly on the scanner objects.

Parameters
imageDescriptionInput image description pointer. Must not be null.
dataInput image data pointer. Must not be null.
Exceptions
RuntimeExceptionException indicating errors in the recognition engine.
Since
4.7.0
void processFrame ( Image  frame)

Process image frame with this recognition context.

The image is processed by the scanners associated with this context. The results, for example the recognized barcodes, can be accessed directly on the scanner objects.

Parameters
framethe frame to be processed. At the moment, only YUV-based format with 420 subsampling are supported. This restriction may be lifted in future versions.
Exceptions
RuntimeExceptionException indicating errors in the recognition engine.
Since
5.1.0

Member Data Documentation

final String VERSION
static

The framework version string of the Scandit BarcodeScanner.

The version string is of the form $major.$minor.$patch$suffix, where suffix can indicate a pre-release version, e.g. BETA1, or be an empty string.

Since
4.12.0

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