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 Xamarin.Android and Data Capture SDK Documentation for Xamarin.iOS

Inherits ScanditSDKBarcodePicker.

Public Member Functions

 LegacyPortraitScanditSDKBarcodePicker (Context context, string appKey)
 
 LegacyPortraitScanditSDKBarcodePicker (Context context, string appKey, int cameraFacingPreference)
 
Barcode Decoder Operations

Start and stop the barcode decoder

bool IsScanning ()
 
void StartScanning ()
 
void StopScanning ()
 
void ResumeScanning ()
 
void PauseScanning ()
 
void Reset ()
 
Barcode Decoder Configuration

Adjust the decoding process and area.

void RestrictActiveScanningArea (bool restrict)
 
void SetScanningHotSpot (float x, float y)
 
void SetScanningHotSpotHeight (float height)
 
void SetMicroDataMatrixEnabled (bool enabled)
 
void SetInverseRecognitionEnabled (bool enabled)
 
void Force2dRecognition (bool force)
 
Barcode Symbology Selection

Configure which symbologies are decoded.

void Set1DScanningEnabled (bool enabled)
 
void Set2DScanningEnabled (bool enabled)
 
void SetEan13AndUpc12Enabled (bool enabled)
 
void SetEan8Enabled (bool enabled)
 
void SetUpceEnabled (bool enabled)
 
void SetCode39Enabled (bool enabled)
 
void SetCode93Enabled (bool enabled)
 
void SetCode128Enabled (bool enabled)
 
void SetItfEnabled (bool enabled)
 
void SetMsiPlesseyEnabled (bool enabled)
 
void SetMsiPlesseyChecksumType (SIMsiPlesseyChecksumType checksumType)
 
void SetGS1DataBarEnabled (bool enabled)
 
void SetGS1DataBarExpandedEnabled (bool enabled)
 
void SetGS1DataBarLimitedEnabled (bool enabled)
 
void SetCodabarEnabled (bool enabled)
 
void SetQrEnabled (bool enabled)
 
void SetCode11Enabled (bool enabled)
 
void SetCode25Enabled (bool enabled)
 
void SetMaxiCodeEnabled (bool enabled)
 
void SetDataMatrixEnabled (bool enabled)
 
void SetAztecEnabled (bool enabled)
 
void SetPdf417Enabled (bool enabled)
 
Torch Control

Switch torch programmatically

void SwitchTorchOn (bool on)
 
Zoom Access
void SetZoom (float zoomPercentage)
 
void SetZoom (int zoom)
 
Camera Frame Access
void setCaptureListener (ScanditSDKCaptureListener listener)
 
byte[] GetMostRecentCameraPreviewImage ()
 
byte[] GetCameraPreviewImageOfFirstBarcodeRecognition ()
 
int CameraPreviewImageWidth (get;) public int CameraPreviewImageHeight(get
 
Camera Feed Display
void IgnorePreviewAspectRatio ()
 
Development options
void SetProperty (string name, Object value)
 
Object GetProperty (string name)
 

Static Public Member Functions

static bool CanRunPortraitPicker ()
 

Static Public Attributes

static final int CAMERA_FACING_BACK
 
static final int CAMERA_FACING_FRONT
 
static final int CHECKSUM_MOD_10
 

Properties

IScanditSDKOverlay OverlayView [get]
 

Camera Selection

Select, choose or determine camera orientation.

bool SupportsCameraFacing (int facing)
 
bool ChangeCameraFacing (int facing)
 
bool SwitchCameraFacing ()
 
int CameraFacingDirection [get]
 

Detailed Description

Controls the scanning process and presents a non-customizable, full screen scan portrait(!) scan UI on devices that only offer a landscape camera feed.

This is the legacy version of the barcode picker that enables compatibility with Android 2.1 devices or devices with newer versions that have camera drivers that fail to offer a working portrait camera feed.

Developers can call ScanditSDKBarcodePicker::canRunPortraitPicker() to determine whether the particular Android device supports the default portrait picker or only this legacy version.

Apps implementing the Scandit SDK should either use the ScanditSDKAutoAdjustingBarcodePicker and show the scan user interface in full screen in a new Activity or selectively decide to show the LegacyPortraitScanditSDKBarcodePicker via calling ScanditSDKBarcodePicker::canRunPortraitPicker(). when a landscape camera feed is not available.

Copyright 2010 Scandit AG. All rights reserved.

Constructor & Destructor Documentation

LegacyPortraitScanditSDKBarcodePicker ( Context  context,
string  appKey 
)

Initiates the barcode picker.

To enable the analytics and location capabilities of the Scandit SDK, set the parameters accordingly. The app key is mandatory and is available via the Scandit SDK website.

Parameters
contextA context.
appKeyThe Scandit SDK app key.
LegacyPortraitScanditSDKBarcodePicker ( Context  context,
string  appKey,
int  cameraFacingPreference 
)

Initiates the barcode picker.

To enable the analytics and location capabilities of the Scandit SDK, set the parameters accordingly. The app key is mandatory and is available via the Scandit SDK website.

Parameters
contextA context.
appKeyThe Scandit SDK app key.
cameraFacingPreferenceWhich camera should be used assuming there is more than one available. Either CAMERA_FACING_BACK or CAMERA_FACING_FRONT.

Member Function Documentation

static bool CanRunPortraitPicker ( )
staticinherited

Returns true if the ScanditSDKBarcodePicker can be used in portrait scanning mode for the particular Android device.

If the method returns false (on all Android 2.1 devices and a few, selected Android 2.2 devices with faulty camera drivers which do not support a portrait camera feed e.g. the Samsung Ace or Y), use this method to decide to use the ScanditSDKBarcodePicker in landscape mode or alternatively the LegacyPortraitScanditSDKBarcodePicker (requires full screen scan ui) on these devices. You can also use the ScanditSDKAutoAdjustingBarcodePicker which handles this automatically for you but requires a full screen scan ui.

Returns
Whether the device supports regular portrait camera feed.
bool SupportsCameraFacing ( int  facing)
inherited

Returns whether the specified camera facing direction is supported by the current device.

Since
3.0.0
Parameters
facingThe camera facing direction in question.
Returns
Whether the camera facing direction is supported
bool ChangeCameraFacing ( int  facing)
inherited

Changes to the specified camera facing direction if it is supported.

The legacy picker will never switch away from the default camera.

Since
3.0.0
Parameters
facingThe new camera facing direction.
Returns
Whether the change was successful.
bool SwitchCameraFacing ( )
inherited

Changes to the opposite camera facing if it is supported.

The legacy picker will never switch away from the default camera.

Since
3.0.0
Returns
Whether the change was successful
bool IsScanning ( )
inherited

Returns true if scanning is in progress.

Since
1.0.0
Returns
Whether scanning is in progress.
void StartScanning ( )
inherited

Starts the scanning process.

This locks the device's camera and gives you the responsibility to unlock the camera again with StopScanning(). The way Android handles the camera lock you will need to unlock it at the latest when your Activity loses focus (in Activity.onPause()) to not cause problems for other apps.

See also
StopScanning()
Since
1.0.0
void StopScanning ( )
inherited

Stops the scanning process.

This unlocks the device's camera if it was previously locked by ScanditSDK::startScanning().

See also
ScanditSDK::startScanning()
Since
1.0.0
void ResumeScanning ( )
inherited

Resume scanning after pauseScanning() was called.

Since
4.0.0
void PauseScanning ( )
inherited

Pauses scanning while keeping the camera feed running.

Since
4.0.0
void Reset ( )
inherited

Resets the state of the barcode picker.

Since
1.0.0
void RestrictActiveScanningArea ( bool  restrict)
inherited

Reduces the area in which barcodes are detected and decoded.

When activated, the active scanning area is defined by setScanningHotSpotHeight(float) and setScanningHotSpot(float, float). If this method is not enabled, barcodes in the full camera image are detected and decoded.

By default this is not enabled.

Since
4.0.0
Parameters
restrictWhether the scanning area should be restricted.
void SetScanningHotSpot ( float  x,
float  y 
)
inherited

Sets the location in the image where barcodes are decoded with the highest priority.

This method shows a slightly different behavior depending on whether the full screen scanning is active or not. In Full screen scanning mode:

Sets the location in the image which is decoded with the highest priority when multiple barcodes are present in the image.

In restrictActiveScanningArea mode (activated with restrictActiveScanningArea(bool)):

Changes the location of the spot where the barcode decoder actively scans for barcodes.

X and Y can be between 0 and 1, where 0/0 corresponds to the top left corner and 1/1 to the bottom right corner.

The default hotspot is set to 0.5/0.5

See also
ScanditSDKBarcodePicker::restrictActiveScanningArea(bool)
ScanditSDKBarcodePicker::setScanningHotSpotHeight(float)
Since
1.0.0
Parameters
xThe hotspot's relative x coordinate.
yThe hotspot's relative y coordinate.
void SetScanningHotSpotHeight ( float  height)
inherited

Changes the height of the area where barcodes are decoded in the camera image when restrictActiveScanningArea is activated.

The height of the active scanning area is relative to the height of the screen and has to be between 0.0 and 0.5.

This only applies if the active scanning area is restricted.

The default is 0.25

See also
ScanditSDKBarcodePicker::restrictActiveScanningArea(bool)
ScanditSDKBarcodePicker::setScanningHotSpot(float, float)
Since
1.0.0
Parameters
heightThe relative height of the active scanning area.
void SetMicroDataMatrixEnabled ( bool  enabled)
inherited

Enable the detection/decoding of tiny Data Matrix and/or QR codes.

When this mode is enabled, a dedicated localization algorithm is activated that searches for small Datamatrix codes in the central part of the camera image. This algorithm requires additional resources and slows down the recognition of other barcode symbologies. We recommend using the method only when your application requires the decoding of tiny Datamatrix codes.

By default this mode is disabled.

Since
3.0.0
Parameters
enabledWhether this mode should be enabled.
void SetInverseRecognitionEnabled ( bool  enabled)
inherited

Enables the detection of white on black codes.

This option currently only works for Data Matrix codes.

By default this mode is disabled.

Since
3.0.0
Parameters
enabledWhether this mode should be enabled.
void Force2dRecognition ( bool  force)
inherited

Forces the barcode scanner to always run the 2D decoders (QR, Datamatrix, etc.), even when the 2D detector did not detect the presence of a 2D code.

This slows down the overall scanning speed, but can be useful when your application only tries to read QR codes. It is by default enabled when the micro Datamatrix mode is enabled.

By default, this is disabled.

Parameters
forcebool indicating whether this mode should be enabled.
Since
2.0.0
void Set1DScanningEnabled ( bool  enabled)
inherited

Enables or disables the recognition of all 1D barcode symbologies supported by the particular Scandit SDK edition you are using.

By default all 1D symbologies except for MSI Plessey and GS1 DataBar are enabled.

Since
1.0.0
Parameters
enabledWhether all 1D symbologies should be enabled.
void Set2DScanningEnabled ( bool  enabled)
inherited

Enables or disables the recognition of 2D barcode symbologies supported by the particular Scandit SDK edition you are using.

By default only QR is enabled.

Since
1.0.0
Parameters
enabledboolean indicating whether all 2D symbologies are enabled
void SetEan13AndUpc12Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for EAN13 and UPC12/UPCA codes.

By default scanning of EAN13 and UPC barcodes is enabled.

Since
1.0.0
Parameters
enabledboolean indicating whether this symbology should be enabled.
void SetEan8Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for EAN8 codes.

By default scanning of EAN8 barcodes is enabled.

Since
1.0.0
Parameters
enabledboolean indicating whether this symbology should be enabled.
void SetUpceEnabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for UPCE codes.

By default scanning of UPCE barcodes is enabled.

Since
1.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetCode39Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for Code39 codes.

By default scanning of Code39 barcodes is enabled. Note: Code39 scanning is only available with the Professional and Enterprise Packages.

Since
1.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetCode93Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for Code93 codes.

By default scanning of Code93 barcodes is disabled. Note: Code93 scanning is only available with the Professional and Enterprise Packages.

Since
4.1.0
Parameters
enabledWhether this symbology should be enabled.
void SetCode128Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for Code128 codes.

By default scanning of Code128 barcodes is enabled. Note: Code28 scanning is only available with the Professional and Enterprise Packages.

Since
1.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetItfEnabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for ITF (Interleaved 2 out of 5) codes.

By default scanning of ITF barcodes is enabled. Note: ITF scanning is only available with the Professional and Enterprise Packages.

Since
1.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetMsiPlesseyEnabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for MSI Plessey codes.

By default scanning of MSI Plessey barcodes is disabled. Note: MSI Plessey scanning is only available with the Professional and Enterprise Packages.

Since
3.2.0
Parameters
enabledWhether this symbology should be enabled.
void SetMsiPlesseyChecksumType ( SIMsiPlesseyChecksumType  checksumType)
inherited

Sets the type of checksum that is expected of the MSI Plessey codes.

MSI Plessey is used with different checksums. Set the checksum your application uses with this method.

By default it is set to CHECKSUM_MOD_10.

Since
3.2.0
Parameters
checksumTypeThe MSIPlesseyChecksumType your application uses.
void SetGS1DataBarEnabled ( bool  enabled)
inherited

Enables or disables the recognition of DataBar 14 codes.

By default scanning of GS1 Databar 14 barcodes is disabled. Note: GS1 Databar 14 scanning is only available with the Professional and Enterprise Packages.

Since
4.1.0
Parameters
enabledWhether it should be enabled. Default is false.
void SetGS1DataBarExpandedEnabled ( bool  enabled)
inherited

Enables or disables the recognition of DataBar Expanded codes.

By default scanning of GS1 Databar Expanded barcodes is disabled. Note: GS1 Databar Expanded scanning is only available with the Professional and Enterprise Packages.

Since
4.1.0
Parameters
enabledWhether it should be enabled. Default is false.
void SetGS1DataBarLimitedEnabled ( bool  enabled)
inherited

Enables or disables the recognition of DataBar Limited codes.

By default scanning of GS1 Databar Limited barcodes is disabled. Note: GS1 Databar Limited scanning is only available with the Professional and Enterprise Packages.

Since
4.11.0
Parameters
enabledWhether it should be enabled. Default is false.
void SetCodabarEnabled ( bool  enabled)
inherited

Enables or disables the recognition of Codabar codes.

By default scanning of Codabar barcodes is disabled. Note: Codabar scanning is only available with the Professional and Enterprise Packages.

Parameters
enabledWhether it should be enabled. Default is false.
void SetQrEnabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for QR codes.

By default scanning of QR barcodes is enabled.

Since
2.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetCode11Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for Code11 codes.

By default scanning of Code11 barcodes is disabled. Note: Code11 scanning is only available with the Professional and Enterprise Packages.

Since
4.9.0
Parameters
enabledWhether this symbology should be enabled.
void SetCode25Enabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for Code25 codes.

By default scanning of Code25 barcodes is enabled. Note: Code25 scanning is only available with the Professional and Enterprise Packages.

Since
4.13.0
Parameters
enabledWhether this symbology should be enabled.
void SetMaxiCodeEnabled ( bool  enabled)
inherited

Enables or disables the recognition of MaxiCodes.

By default scanning of MaxiCodes is disabled.

Note: MaxiCode scanning is only available with the Professional and Enterprise Packages.

Since
4.9.0
Parameters
enabledWhether it should be enabled. Default is false.
void SetDataMatrixEnabled ( bool  enabled)
inherited

Enables or disables the barcode decoder for Datamatrix codes.

By default scanning of Datamatrix codes is enabled.

Note: Datamatrix scanning is only available with the Professional and Enterprise Packages.

Since
2.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetAztecEnabled ( bool  enabled)
inherited

Enables or disables the recognition of Aztec codes.

By default scanning of Aztec codes is disabled.

Note: Aztec scanning is only available with the Professional and Enterprise Packages.

Since
4.3.0
Parameters
enabledWhether it should be enabled. Default is false.
void SetPdf417Enabled ( bool  enabled)
inherited

Enables or disables the recognition of PDF 417 codes.

By default scanning of PDF417 codes is disabled.

Note: PDF417 scanning is only available with the Professional and Enterprise Packages.

Since
4.0.0
Parameters
enabledWhether this symbology should be enabled.
void SwitchTorchOn ( bool  on)
inherited

Switches the torch on or off.

If the torch button is enabled on the overlay, users can change this by clicking it.

Since
2.0.0
Parameters
onWhether the torch should be on.
void SetZoom ( float  zoomPercentage)
inherited

Sets the zoom to the given percentage of the max zoom possible.

Parameters
zoomPercentageThe percentage of the max zoom (between 0 and 1).
void SetZoom ( int  zoom)
inherited

Sets the zoom level as defined by the Android Camera.

Parameters
zoomZoom level (0 to max zoom)
void setCaptureListener ( ScanditSDKCaptureListener  listener)
inherited

Sets a listener object for capture events.

Parameters
listenerThe listener.
byte [] GetMostRecentCameraPreviewImage ( )
inherited

Returns the last image returned by the Camera.

(The image will be "landscape" oriented. It's dimensions can be accessed using CameraPreviewImageWidth() and CameraPreviewImageHeight().)

Since
1.0.0
Returns
Byte array containing the image information in the NV21 format (YCrCb format, which uses the NV21 encoding format) or null, in case no preview image has been obtained so far
byte [] GetCameraPreviewImageOfFirstBarcodeRecognition ( )
inherited

Returns the image in which the bar code has been recognized for the first time.

The image will be "landscape" oriented. It's dimensions can be accessed using CameraPreviewImageWidth() and CameraPreviewImageHeight().

Since
1.0.0
Returns
Byte array containing the image information in the NV21 format (YCrCb format, which uses the NV21 encoding format), or null, in case no barcode has been recognized since the recognition start or the last call of reset().
int CameraPreviewImageWidth ( get;  )
inherited

The width of the preview images from the active camera.

Since
1.0.0
Returns
The width of the camera preview image in pixels. The height of the preview images from the active camera.
Since
1.0.0
Returns
The height of the camera preview image in pixels.
void IgnorePreviewAspectRatio ( )
inherited

Makes the picker ignore the screen's aspect ratio.

Normally the picker adjusts to the aspect ratio of the preview image. If this is called, it will no longer do this. Warning: If the aspect ratio is not kept, the camera feed may be stretched and no longer be a proper representation of what is recorded.

Since
2.0.0
void SetProperty ( string  name,
Object  value 
)
inherited

Sets a property.

This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.

Since
1.0.0
Parameters
nameThe property's name.
valueThe property's value.
Object GetProperty ( string  name)
inherited

Gets a property.

This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.

Since
1.0.0
Parameters
nameThe property's name.
Returns
The property's value.

Member Data Documentation

final int CAMERA_FACING_BACK
staticinherited

Default camera orientation - facing away from user.

final int CAMERA_FACING_FRONT
staticinherited

Facetime camera orientation - facing the user.

final int CHECKSUM_MOD_10
staticinherited

Default MSI Plessey Checksum.

Property Documentation

IScanditSDKOverlay OverlayView
getinherited

Returns the overlay view.

Use this method to access the ScanditSDKOverlay and customize the scan UI. See ScanditSDKOverlay for all the available options.

Returns
The overlay view on top of the camera feed. This view is always a RelativeLayout.
int CameraFacingDirection
getinherited

Returns which direction the currently shown camera is facing.

Since
3.0.0
Returns
Which way the camera faces, either CAMERA_FACING_BACK or CAMERA_FACING_FRONT.