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

SIBarcodePicker Interface Reference

Properties

SIOverlayController OverlayController [get, set]
 
SizeF Size [get, set]
 
AVCaptureVideoOrientation CameraPreviewOrientation [get, set]
 
SICameraFacingDirection CameraFacingDirection [get]
 

Barcode Picker Setup

Initialize and prepare the barcode picker, control standby state and set overlay

void Prepare (string appKey)
 
void Prepare (string appKey, SICameraFacingDirection facing)
 
IntPtr Constructor (string appKey)
 
IntPtr Constructor (string appKey, SICameraFacingDirection facing)
 
void DisableStandbyState ()
 

Camera Selection

Select, choose or determine camera orientation

bool SupportsCameraFacing (SICameraFacingDirection facing)
 
bool ChangeToCameraFacing (SICameraFacingDirection facing)
 
bool SwitchCameraFacing ()
 

Barcode Decoder Operation

Start and stop barcode decoder

bool IsScanning [get]
 
void StartScanning ()
 
void StopScanning ()
 
void StopScanningAndKeepTorchState ()
 

Barcode Decoder Configuration

Adjust the decoding process and area.

void RestrictActiveScanningArea (bool enabled)
 
void SetScanningHotSpot (float x, float y)
 
void SetScanningHotSpotHeight (float height)
 
void SetMicroDataMatrixEnabled (bool enabled)
 
void SetInverseDetectionEnabled (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 SetMaxiCodeEnabled (bool enabled)
 
void SetCode11Enabled (bool enabled)
 
void SetCode25Enabled (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 SetDataMatrixEnabled (bool enabled)
 
void SetPdf417Enabled (bool enabled)
 
void SetAztecEnabled (bool enabled)
 

Torch Control

Switch torch programmatically

void SwitchTorchOn (bool enabled)
 

Camera Frame Access

void SendNextFrameToDelegate (SINextFrameDelegate nextFrameDelegate)
 

Detailed Description

Acquires camera frames, decodes barcodes in those camera frames and updates the SIOverlayController.

Example (minimal) usage:

Set up the barcode picker in one of your view controllers:

// Instantiate the barcode picker.
SIBarcodePicker barcodePicker = new SIBarcodePicker ("yourAppKey");
// Set a class as the delegate for the overlay controller to handle events when
// a barcode is successfully scanned or manually entered or the cancel button is pressed.
// This class has to inherit from the SIOverlayControllerDelegate interface.
barcodePicker.OverlayController.Delegate = new SIOverlayControllerDelegate(picker, this);
// Present the scan view modally.
PresentViewController(barcodePicker, true, null);
// Start the scanning
barcodePicker.startScanning();
Since
1.0.0

Copyright Mirasense AG

Member Function Documentation

void Prepare ( string  appKey)

Prepares a ScanditSDKBarcodePicker which accelerates the camera start.

We no longer recommend to use this method since the impact on performance is no longer as significant with iOS7/8 and the recent generation of ios devices.

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.

The method prepares the default backwards facing camera.

Since
3.0.0
Parameters
appKeyYour Scandit SDK App Key (available from your Scandit account)
void Prepare ( string  appKey,
SICameraFacingDirection  facing 
)

Prepares a ScanditSDKBarcodePicker which accelerates the camera start with the desired camera orientation.

We no longer recommend to use this method since the impact on performance is no longer as significant with iOS7/8 and the recent generation of ios devices.

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.

Since
3.0.0
Parameters
appKeyYour Scandit SDK App Key (available from your Scandit account)
facingThe desired camera direction
IntPtr Constructor ( string  appKey)

Initiate the barcode picker with the default camera orientation (CameraFacingDirectionBack).

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.

Since
2.0.0
Parameters
appKeyYour Scandit SDK App Key (available from your Scandit account).
Returns
Instance of SIBarcodePicker
IntPtr Constructor ( string  appKey,
SICameraFacingDirection  facing 
)

Initializes the barcode picker with the desired camera orientation.

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.

Since
2.1.7
Parameters
appKeyYour Scandit SDK app key (available from your Scandit account).
facingThe desired camera direction.
Returns
Instance of SIBarcodePicker
void DisableStandbyState ( )

Prevents the camera from entering a standby state after the barcode picker object is deallocated.

This will free up resources (power, memory) after each scan that are used by the camera in standby mode, but also increases the startup time and time to successful scan for subsequent scans. This method is not enabled by default. We recommend enabling it when conserving battery power is important.

Since
3.0.0
bool SupportsCameraFacing ( SICameraFacingDirection  facing)

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 ChangeToCameraFacing ( SICameraFacingDirection  facing)

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

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

Changes to the opposite camera facing if it is supported.

Since
3.0.0
Returns
Whether the change was successful
void StartScanning ( )

Starts/restarts the scanning process.

Start or continue scanning barcodes after the creation of the barcode picker or a previous call to stopScanning() or stopScanningAndKeepTorchState().

Since
1.0.0
void StopScanning ( )

Stops the scanning process.

See also
ScanditSDKBarcodePicker::stopScanningAndKeepTorchState()
Since
1.0.0
void StopScanningAndKeepTorchState ( )

Stops the scanning process but keeps the torch on if it is already turned on.

This is useful when the scan user interface remains visible after a successful barcode scan. To prevent additional scans of the same barcode, the scanner needs to be stopped at least temporarily. To avoid making the user switch on the torch again for the next scan, we recommend using this method instead of :stopScanning:

Since
3.0.0
void RestrictActiveScanningArea ( bool  enabled)

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.

See also
ScanditSDKBarcodePicker::setScanningHotSpot(float, float)
ScanditSDKBarcodePicker::setScanningHotSpotHeight(float)

By default this is not enabled.

Since
3.0.0
Parameters
enabledWhether the scanning area should be restricted.
void SetScanningHotSpot ( float  x,
float  y 
)

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)

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)

Enable the detection/decoding of tiny Data Matrix 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
2.0.0
Parameters
enabledWhether this mode should be enabled.
void SetInverseDetectionEnabled ( bool  enabled)

Enables the detection of white on black codes.

This option currently only works for Data Matrix and QR codes.

By default this mode is disabled.

Since
2.0.0 (4.4.0 for QR)
Parameters
enabledWhether this mode should be enabled.
void Force2dRecognition ( bool  force)

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
forceboolean indicating whether this mode should be enabled.
Since
2.0.0
void Set1DScanningEnabled ( bool  enabled)

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)

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)

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
enabledWhether this symbology should be enabled.
void SetEan8Enabled ( bool  enabled)

Enables or disables the barcode decoder for EAN8 codes.

By default scanning of EAN8 barcodes is enabled.

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

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)

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 Scandit SDK Enterprise Basic or Enterprise Premium Package.

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

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 Scandit SDK Enterprise Basic or Enterprise Premium Package.

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

Enables or disables the barcode decoder for MaxiCode codes.

By default scanning of MaxiCode barcodes is disabled. Note: MaxiCode scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.9.0
Parameters
enabledboolean indicating whether this symbology should be enabled.
void SetCode11Enabled ( bool  enabled)

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 Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.9.0
Parameters
enabledboolean indicating whether this symbology should be enabled.
void SetCode25Enabled ( bool  enabled)

Enables or disables the barcode decoder for Code25 codes.

By default scanning of Code25 barcodes is disabled. Note: Code25 scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.13.0
Parameters
enabledboolean indicating whether this symbology should be enabled.
void SetCode128Enabled ( bool  enabled)

Enables or disables the barcode decoder for Code128 codes.

By default scanning of Code128 barcodes is enabled. Note: CODE128 scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

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

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

By default scanning of ITF barcodes is enabled. Note: ITF scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

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

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 Scandit SDK Enterprise Basic or Enterprise Premium Package.

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

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.0.0
Parameters
checksumTypeThe MSIPlesseyChecksumType your application uses.
void SetGS1DataBarEnabled ( bool  enabled)

Enables or disables the barcode decoder for GS1 DataBar codes.

By default scanning of GS1 DataBar barcodes is disabled. Note: GS1 DataBar scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetGS1DataBarExpandedEnabled ( bool  enabled)

Enables or disables the barcode decoder for GS1 DataBar Expanded codes.

By default scanning of GS1 DataBar Expanded barcodes is disabled. Note: GS1 DataBar scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.0.0
Parameters
enabledWhether this symbology should be enabled.
void SetGS1DataBarLimitedEnabled ( bool  enabled)

Enables or disables the barcode decoder for GS1 DataBar Limited codes.

By default scanning of GS1 DataBar Limited barcodes is disabled. Note: GS1 DataBar scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.11.0
Parameters
enabledWhether this symbology should be enabled.
void SetCodabarEnabled ( bool  enabled)

Enables or disables the barcode decoder for Codabar codes.

By default scanning of Codabar barcodes is disabled. Note: Codabar scanning is only available with the Scandit SDK Enterprise Basic or Enterprise Premium Package.

Since
4.0.0
Parameters
enabledboolean indicating whether this symbology should be enabled.
void SetQrEnabled ( bool  enabled)

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 SetDataMatrixEnabled ( bool  enabled)

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 Scandit SDK Enterprise Premium Package.

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

Enables or disables the barcode decoder for PDF417 codes.

By default scanning of PDF417 codes is disabled (since 3.2.0).

Note: PDF417 scanning is only available with the Scandit SDK Enterprise Premium Package.

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

Enables or disables the barcode decoder for Aztec codes.

By default scanning of Aztec codes is disabled.

Note: Aztec scanning is only available with the Scandit SDK Enterprise Premium Package.

Since
4.3.0
Parameters
enabledWhether this symbology should be enabled.
void SwitchTorchOn ( bool  enabled)

Switches the torch (if available) on or off programmatically.

There is also a method in the ScanditSDKOverlayController to add a torch icon that the user can click to activate the torch.

Parameters
enabledTrue when the torch should be switched on, False if the torch should be turned off.

By default the torch switch is off.

Since
2.0.0
void SendNextFrameToDelegate ( SINextFrameDelegate  nextFrameDelegate)

Sets the delegate to which the next frame should be sent.

The next frame from the camera is then converted to a JPEG image and the ScanditSDKBarcodePicker will pass the jpg image, width and height to the delegate. We recommend to not call this method repeatedly while the barcode scanner is running, since the JPG conversion of the camera frame is very slow.

Since
2.0.0
Parameters
nextFrameDelegateimplementing the ScanditSDKNextFrameDelegate protocol

Property Documentation

SIOverlayController OverlayController
getset

The overlay controller controls the scan user interface.

The Scandit SDK contains a default implementation that developers can inherit from to define their own scan UI (enterprise licensees only).

Since
1.0.0
SizeF Size
getset

The size of the scan user interface.

Change the size if you want to scale the picker (see example in the demo project). By default it is set to full screen.

Since
2.1.9
AVCaptureVideoOrientation CameraPreviewOrientation
getset

The orientation of the camera preview.

The orientation of the camera preview. In general the preview's orientation will be as wanted, but there may be cases where it needs to be set individually. This does not change the orientation of the overlayed UI elements.

Possible values are: AVCaptureVideoOrientationPortrait, AVCaptureVideoOrientationPortraitUpsideDown, AVCaptureVideoOrientationLandscapeLeft, AVCaptureVideoOrientationLandscapeRight

SICameraFacingDirection CameraFacingDirection
get

The facing direction of the used camera.

Since
2.0.0
bool IsScanning
get

Returns YES if scanning is in progress.

Since
1.0.0
Returns
boolean indicating whether scanning is in progress.