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

Public Member Functions

 BarcodePicker (Context context, ScanSettings settings)
 
void ApplyScanSettings (ScanSettings settings)
 
void PauseScanning ()
 
void ResumeScanning ()
 
void SetOnScanListener (IOnScanListener listener)
 
void StopScanning ()
 
void StartScanning ()
 
void StartScanning (bool startInPausedState)
 
void SwitchTorchOn (bool on)
 
void SetProcessFrameListener (IProcessFrameListener processFrameListener)
 
Point ConvertPointToPickerCoordinates (Point point)
 
void SetPinchToZoomEnabled (bool enabled)
 

Static Public Member Functions

static bool CanRunPortraitPicker ()
 

Public Attributes

readonly ScanOverlay OverlayView
 

Detailed Description

The main interface for scanning barcodes with the Scandit BarcodeScanner SDK.

This class sets up the recognition process, the preview view, controls the camera and provides a callback interface when barcodes are recognized.

The picker class is a able to run in full-screen or as a subview in an existing activity.

As of Scandit BarcodeScanner SDK 4.9.0, the BarcodePicker class replaces the ScanditSDKBarcodePicker and related classes. These classes remain available but have been deprecated.

Since
4.9.0

Constructor & Destructor Documentation

BarcodePicker ( Context  context,
ScanSettings  settings 
)

Construct a new barcode picker with the given scan settings.

Parameters
contextthe context that the barcode picker belongs to.
settingsthe settings to use.

Member Function Documentation

void ApplyScanSettings ( ScanSettings  settings)

Reconfigure the barcode picker with new settings.

The settings are applied asynchronously. Once they have been applied, all new frames will be processed with the new settings.

Parameters
settingsthe settings to apply.
void PauseScanning ( )

Asynchronously pause the scanning process while keeping the camera preview running.

Use this method when you plan to briefly pause the scanning process and intend to resume it later. It is not recommended to use this method when you are interrupting the scanning process for longer periods of time as the camera preview will use considerable power. For such scenarios use StopScanning instead.

Since
4.9.0
void ResumeScanning ( )

Asynchronously resume a previously paused scanning process.

Use this method to resume scanning after IScanSession.PauseScanning or PauseScanning was called. Calling resume on a picker that was not previously started with with startScanning() is undefined.

Since
4.9.0
void SetOnScanListener ( IOnScanListener  listener)

Set callback to be invoked whenever a new code is recognized.

See also
OnScanListener.didScan
Parameters
listenerthe listener to register. A strong reference is kept to the listener.
void StopScanning ( )

Asynchronously stop the scanning process and camera preview.

void StartScanning ( )

Asynchronously start the camera preview and scanning process.

void StartScanning ( bool  startInPausedState)

Asynchronously start the camera preview and scanning process.

Allows to start the camera preview without immediately also starting the scanning process.

Parameters
startInPausedStateWhether the scanning process should be paused.
void SwitchTorchOn ( bool  on)

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
ontrue when the torch should be switched on, false if the torch should be turned off.
void SetProcessFrameListener ( IProcessFrameListener  processFrameListener)

Set listener to be called whenever a frame has been processed.

Parameters
processFrameListenerthe listener to register.
static bool CanRunPortraitPicker ( )
static
Returns
True if the BarcodePicker can be used in portrait scanning mode. This method only returns false on a few selected Android 2.3+ devices that have incomplete camera drivers.
Point ConvertPointToPickerCoordinates ( Point  point)

Converts a point of an Barcode's location into this picker's coordinate system.

The conversion takes the current resolution of the camera feed into consideration which means that if the resolution should change, converting a previously retrieved point successfully is no longer possible. A change in resolution happens for example if ScanSettings.HighDensityModeEnabled is changed or the camera is switched from back to front or vice versa.

Parameters
pointThe point to be converted.
Returns
The point in this picker's coordinate system. Can be null if an error occurs.
See also
ScanditBarcodeScanner.Android.Recognition.Barcode.Location
void SetPinchToZoomEnabled ( bool  enabled)

Enable/disable pinch to zoom.

By default, the video zoom factor can be controlled with a pinch gesture. Set this property to false to disable this feature.

Parameters
enabledWhether pinch to zoom should be enabled.
Since
4.15

Member Data Documentation

readonly ScanOverlay OverlayView

The overlay view controls the scan user interface.

The Scandit BarcodeScanner contains a default implementation that developers can inherit from to define their own scan UI (enterprise licensees only). The overlay view inherits from RelativeLayout.