Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

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)

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.


Constructor & Destructor Documentation

BarcodePicker ( Context  context,
ScanSettings  settings 

Construct a new barcode picker with the given scan settings.

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.

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.

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.

void SetOnScanListener ( IOnScanListener  listener)

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

See also
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.

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.

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.

processFrameListenerthe listener to register.
static bool CanRunPortraitPicker ( )
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.

pointThe point to be converted.
The point in this picker's coordinate system. Can be null if an error occurs.
See also

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.