Migrate from Barcode Scanner 5.x
This guide will help you migrate from Barcode Scanner 5.x to version 6.x of the Scandit Smart Data Capture SDK. Version 6.0 introduces all new APIs that are not backwards compatible with apps using ScanditSDK 5.x. To migrate your code to SDK 6.0 and newer, you will need to modify your app.
If you are unsure about how to perform the migration or the feature you are using is not covered in this migration guide, please reach out to our support team.
Replace the BarcodePicker
In 5.x, the BarcodePicker (SBSBarcodePicker on iOS) was the central class that manages recognition, renders the video preview and provides means to configure what barcodes get scanned. In 6.0 and newer, there is no direct equivalent to the BarcodePicker. Instead this functionality is covered by multiple classes:
- Android
- iOS
- Web
- Cordova
- React Native
- Flutter
- Xamarin iOS
- Xamarin Android
- Xamarin Forms
- .NET iOS
- .NET Android
- Titanium
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
dataCaptureContext = DataCaptureContext.forLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
camera = Camera.getDefaultCamera();
dataCaptureContext.setFrameSource(camera, null);
// See below for differences between 5.x and 6.x.
BarcodeCaptureSettings barcodeCaptureSettings = new BarcodeCaptureSettings();
barcodeCaptureSettings.enableSymbology(Symbology.EAN13_UPCA);
barcodeCapture = BarcodeCapture.forDataCaptureContext(dataCaptureContext, barcodeCaptureSettings);
barcodeCapture.addListener(this);
barcodeCapture.setEnabled(true);
BarcodeCaptureOverlay overlay = new BarcodeCaptureOverlay(barcodeCapture);
dataCaptureView = DataCaptureView.newInstance(this, dataCaptureContext);
dataCaptureView.addOverlay(overlay);
setContentView(dataCaptureView);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
// Create data capture context using your license key.
context = DataCaptureContext(licenseKey: yourLicenseKey)
// Set the back (world)-facing camera as the frame source of the context.
camera = Camera.default
context.setFrameSource(camera, completionHandler: nil)
// See below for differences between 5.x and 6.x.
let settings = BarcodeCaptureSettings()
settings.set(symbology: .ean13UPCA, enabled: true)
// Create new barcode capture mode with the settings from above.
barcodeCapture = BarcodeCapture(context: context, settings: settings)
// Register self as a listener to get informed whenever a new barcode got recognized.
barcodeCapture.addListener(self)
captureView = DataCaptureView(frame: view.bounds)
captureView.context = context
captureView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(captureView)
overlay = BarcodeCaptureOverlay(barcodeCapture: barcodeCapture)
captureView.addOverlay(overlay)
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
import * as SDCCore from "scandit-web-datacapture-core";
import * as SDCBarcode from "scandit-web-datacapture-barcode";
// Create data capture context.
context = await SDCCore.DataCaptureContext.create();
// The device camera will serve as a frame source.
camera = SDCCore.Camera.default;
await context.setFrameSource(camera);
// See below for differences between 5.x and 6.x.
const settings = new SDCBarcode.BarcodeCaptureSettings();
settings.enableSymbology(SDCBarcode.Symbology.EAN13UPCA, true);
barcodeCapture = await SDCBarcode.BarcodeCapture.forContext(context, settings);
// Add a listener to get informed whenever a new barcode is recognized.
barcodeCapture.addListener(listener)
view = await SDCCore.DataCaptureView.forContext(context);
// Connect the data capture view to the HTML element, so it can fill up its size and follow its position.
view.connectToElement(element);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
// Create data capture context using your license key.
context = Scandit.DataCaptureContext.forLicenseKey(SCANDIT_LICENSE_KEY);
// The device camera will serve as a frame source.
camera = Scandit.Camera.default;
context.setFrameSource(camera);
// See below for differences between 5.x and 6.x.
const settings = new Scandit.BarcodeCaptureSettings();
settings.enableSymbology(Scandit.Symbology.EAN13UPCA, true);
barcodeCapture = Scandit.BarcodeCapture.forContext(context, settings);
// Add a listener to get informed whenever a new barcode is recognized.
barcodeCapture.addListener(listener)
view = Scandit.DataCaptureView.forContext(context);
// Connect the data capture view to the HTML element, so it can fill up its size and follow its position.
view.connectToElement(element);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
// Create data capture context using your license key.
context = DataCaptureContext.forLicenseKey(SCANDIT_LICENSE_KEY);
// Set the back (world-facing) camera as the frame source of the context.
camera = Camera.default;
context.setFrameSource(camera);
// See below for differences between 5.x and 6.x.
const settings = new BarcodeCaptureSettings();
settings.enableSymbology(Symbology.EAN13UPCA, true);
// Create new barcode capture mode with the settings from above.
barcodeCapture = BarcodeCapture.forContext(context, settings);
// Add a listener to get informed whenever a new barcode is recognized.
barcodeCapture.addListener(listener)
// Render the capture view in the render method.
<DataCaptureView style={{ flex: 1 }} context={this.dataCaptureContext} ref={this.viewRef}>
// Back in the application code, add a barcode capture overlay.
const overlay = BarcodeCaptureOverlay.withBarcodeCaptureForView(this.barcodeCaptureMode, null);
this.viewRef.current.addOverlay(overlay);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
var dataCaptureContext = DataCaptureContext.forLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
var camera = Camera.defaultCamera;
dataCaptureContext.setFrameSource(camera);
// See below for differences between 5.x and 6.x.
var barcodeCaptureSettings = BarcodeCaptureSettings()
..enableSymbology(Symbology.ean13Upca, true);
var barcodeCapture = BarcodeCapture.forContext(dataCaptureContext, barcodeCaptureSettings)
..addListener(this)
..isEnabled = true;
var overlay = BarcodeCaptureOverlay(barcodeCapture);
var dataCaptureView = DataCaptureView.forContext(dataCaptureContext)
..addOverlay(overlay);
// Add the dataCaptureView to your widget tree
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
dataCaptureContext = DataCaptureContext.ForLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
camera = Camera.GetDefaultCamera();
dataCaptureContext.SetFrameSourceAsync(camera);
// See below for differences between 5.x and 6.x.
BarcodeCaptureSettings barcodeCaptureSettings = BarcodeCaptureSettings.Create();
barcodeCaptureSettings.EnableSymbology(Symbology.Ean13Upca, true);
barcodeCapture = BarcodeCapture.Create(dataCaptureContext, barcodeCaptureSettings);
barcodeCapture.AddListener(this);
dataCaptureView = DataCaptureView.Create(dataCaptureContext, View.Bounds);
dataCaptureView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight |
UIViewAutoresizing.FlexibleWidth;
View.AddSubview(dataCaptureView);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
dataCaptureContext = DataCaptureContext.ForLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
camera = Camera.GetDefaultCamera();
dataCaptureContext.SetFrameSourceAsync(camera);
// See below for differences between 5.x and 6.x.
BarcodeCaptureSettings barcodeCaptureSettings = BarcodeCaptureSettings.Create();
barcodeCaptureSettings.EnableSymbology(Symbology.Ean13Upca, true);
barcodeCapture = BarcodeCapture.Create(dataCaptureContext, barcodeCaptureSettings);
barcodeCapture.AddListener(this);
dataCaptureView = DataCaptureView.Create(this, dataCaptureContext);
SetContentView(dataCaptureView);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
dataCaptureContext = DataCaptureContext.ForLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
camera = Camera.GetDefaultCamera();
dataCaptureContext.SetFrameSourceAsync(camera);
// See below for differences between 5.x and 6.x.
BarcodeCaptureSettings barcodeCaptureSettings = BarcodeCaptureSettings.Create();
barcodeCaptureSettings.EnableSymbology(Symbology.Ean13Upca, true);
barcodeCapture = BarcodeCapture.Create(dataCaptureContext, barcodeCaptureSettings);
barcodeCapture.AddListener(this);
dataCaptureView = new DataCaptureView();
dataCaptureView.DataCaptureContext = dataCaptureContext;
dataCaptureView.HorizontalOptions = LayoutOptions.StartAndExpand;
dataCaptureView.HorizontalOptions = LayoutOptions.StartAndExpand;
// Add the datacapture view to the container
containerView.Children.Add(dataCaptureView);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
dataCaptureContext = DataCaptureContext.ForLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
camera = Camera.GetDefaultCamera();
dataCaptureContext.SetFrameSourceAsync(camera);
// See below for differences between 5.x and 6.x.
BarcodeCaptureSettings barcodeCaptureSettings = BarcodeCaptureSettings.Create();
barcodeCaptureSettings.EnableSymbology(Symbology.Ean13Upca, true);
barcodeCapture = BarcodeCapture.Create(dataCaptureContext, barcodeCaptureSettings);
barcodeCapture.AddListener(this);
dataCaptureView = DataCaptureView.Create(dataCaptureContext, View.Bounds);
dataCaptureView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight |
UIViewAutoresizing.FlexibleWidth;
View.AddSubview(dataCaptureView);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
dataCaptureContext = DataCaptureContext.ForLicenseKey(SCANDIT_LICENSE_KEY);
// Device's camera will serve as a frame source.
camera = Camera.GetDefaultCamera();
dataCaptureContext.SetFrameSourceAsync(camera);
// See below for differences between 5.x and 6.x.
BarcodeCaptureSettings barcodeCaptureSettings = BarcodeCaptureSettings.Create();
barcodeCaptureSettings.EnableSymbology(Symbology.Ean13Upca, true);
barcodeCapture = BarcodeCapture.Create(dataCaptureContext, barcodeCaptureSettings);
barcodeCapture.AddListener(this);
dataCaptureView = DataCaptureView.Create(this, dataCaptureContext);
SetContentView(dataCaptureView);
- The
DataCaptureContext
is the central object that manages the data capture/recognition process. - The
Camera
class wraps the native camera on |platform|. - The
ui.DataCaptureView
displays the camera preview as well as augmentations on top of the camera preview. - The
barcode.BarcodeCapture
manages the barcode scanning/capturing process, exposeslisteners<barcode.IBarcodeCaptureListener>
and ways to configure-barcodes.
In your app you will need to use all of these classes to implement the functionality offered by the BarcodePicker. The following sample code shows you how to do this:
// Create data capture context using your license key.
context = ScanditCore.DataCaptureContext.forLicenseKey(SCANDIT_LICENSE_KEY);
// The device camera will serve as a frame source.
camera = ScanditCore.Camera.default;
context.setFrameSource(camera);
// See below for differences between 5.x and 6.x.
const settings = new ScanditBarcode.BarcodeCaptureSettings();
settings.enableSymbology(ScanditBarcode.Symbology.EAN13UPCA, true);
barcodeCapture = ScanditBarcode.BarcodeCapture.forContext(context, settings);
// Add a listener to get informed whenever a new barcode is recognized.
barcodeCapture.addListener(listener)
view = ScanditCore.DataCaptureView.forContext(context);
// Connect the data capture view to the window, so it can fill up its size and follow its position.
view.addToContainer(window);
Start/Stop the Capture Process
- Android
- iOS
- Web
- Cordova
- React Native
- Flutter
- Xamarin iOS
- Xamarin Android
- Xamarin Forms
- .NET iOS
- .NET Android
- Titanium
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.setEnabled(true);
camera.switchToDesiredState(FrameSourceState.ON, null);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.setEnabled(false);
camera.switchToDesiredState(FrameSourceState.OFF, null);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.isEnabled = true
camera?.switch(toDesiredState: .on)
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.isEnabled = false
camera?.switch(toDesiredState: .off)
In 5.x the scan process was started by calling resumeScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
await barcodeCapture.setEnabled(true);
await camera.switchToDesiredState(SDCCore.FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.SetEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.SetEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
await barcodeCapture.setEnabled(false);
await camera.switchToDesiredState(SDCCore.FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.isEnabled = true;
camera.switchToDesiredState(Scandit.FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.isEnabled = false;
camera.switchToDesiredState(Scandit.FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.isEnabled = true;
camera.switchToDesiredState(FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.isEnabled = false;
camera.switchToDesiredState(FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.isEnabled = true;
camera.switchToDesiredState(FrameSourceState.on);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.isEnabled = false;
camera.switchToDesiredState(FrameSourceState.off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.Enabled = true;
camera?.SwitchToDesiredStateAsync(FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.Enabled = false;
camera?.SwitchToDesiredStateAsync(FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.Enabled = true;
camera?.SwitchToDesiredStateAsync(FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.Enabled = false;
camera?.SwitchToDesiredStateAsync(FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.Enabled = true;
camera?.SwitchToDesiredStateAsync(FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.Enabled = false;
camera?.SwitchToDesiredStateAsync(FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.Enabled = true;
camera?.SwitchToDesiredStateAsync(FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.Enabled = false;
camera?.SwitchToDesiredStateAsync(FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.Enabled = true;
camera?.SwitchToDesiredStateAsync(FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.Enabled = false;
camera?.SwitchToDesiredStateAsync(FrameSourceState.Off);
In 5.x the scan process was started by calling startScanning on the BarcodePicker. In 6.0+, the equivalent functionality is to switch the frame source from off to on<IFrameSource.SwitchToDesiredStateAsync>
and to enable the capture mode<IDataCaptureMode.IsEnabled>
.
Capture modes are enabled by default, the first line to enable the capture mode is only required when you are reusing a previously disabled data capture mode.
barcodeCapture.isEnabled = true;
camera.switchToDesiredState(ScanditCore.FrameSourceState.On);
To pause the barcode capture process, simply set the barcode.BarcodeCapture.IsEnabled
property to false
(without turning the camera off). To resume the capture process, set the barcode.BarcodeCapture.IsEnabled
property back to true
.
To stop the barcode capture process and turn the camera off, disable the capture mode and turn the camera off, as shown below:
barcodeCapture.isEnabled = false;
camera.switchToDesiredState(ScanditCore.FrameSourceState.Off);
Barcode Scanner Changes
- The default code duplicate filter has been changed from 500ms to 0ms. This means that a barcode that gets scanned in two consecutive scans will get reported twice. When you pause/stop the scanning as soon as one code gets scanned, the code duplicate filtering setting does not affect you. However if you continue scanning further codes without pausing/stopping recognition, you may want to change the
barcode.BarcodeCaptureSettings.CodeDuplicateFilter
property back to 500ms. - EAN13 and UPCA used to be separate symbologies in 5.x but have now been merged into one symbology called
Ean13Upca
. - The leading zero of UPCA codes is no longer removed by default. If you rely on this behavior in your app, you can either remove the leading zero yourself, or enable the remove_leading_upca_zero extension:
- Android
- iOS
- Web
- Cordova
- React Native
- Flutter
- Xamarin iOS
- Xamarin Android
- Xamarin Forms
- .NET iOS
- .NET Android
- Titanium
settings.getSymbologySettings(Symbology.EAN13_UPCA)
.setExtensionEnabled("remove_leading_upca_zero", true)
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
settings.settings(for: .ean13UPCA)?.set(extension: "remove_leading_upca_zero", enabled: true)
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
settings.settingsForSymbology(SDCBarcode.Symbology.EAN13UPCA).setExtensionEnabled("remove_leading_upca_zero", true);
- The Scanner class functionality is not provided anymore.
settings.settingsForSymbology(Scandit.Symbology.EAN13UPCA).setExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
settings.settingsForSymbology(Symbology.EAN13UPCA).setExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
settings.settingsForSymbology(Symbology.ean13Upca)
.setExtensionEnabled("remove_leading_upca_zero", enabled: true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
barcodeCaptureSettings.GetSymbologySettings(Symbology.Ean13Upca)
.SetExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
barcodeCaptureSettings.GetSymbologySettings(Symbology.Ean13Upca)
.SetExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
barcodeCaptureSettings.GetSymbologySettings(Symbology.Ean13Upca)
.SetExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
barcodeCaptureSettings.GetSymbologySettings(Symbology.Ean13Upca)
.SetExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
barcodeCaptureSettings.GetSymbologySettings(Symbology.Ean13Upca)
.SetExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
settings.settingsForSymbology(ScanditBarcode.Symbology.EAN13UPCA).setExtensionEnabled("remove_leading_upca_zero", true);
- The API to configure the active scan area has been overhauled and simplified. If you were changing the active scan area to match the visible part of the preview, the good news is that the active scan area is now automatically restricted to the visible part of the preview.
- The camera-related settings have been moved from
ScanSettings
toCameraSettings
. For example, if you want to change the preview resolution from 720p to 1080p, set theCameraSettings.PreferredResolution
toVideoResolution.FullHd
andapply the new settings<Camera.ApplySettingsAsync>
to the camera.
MatrixScan Changes
Not applicable for Web and Titanium.
The features that you know under the name MatrixScan are now bundled under barcode.tracking.BarcodeTracking
, the overall concept is still referred to as MatrixScan.
In 5.x setMaxNumberOfCodesPerFrame
was used to adjust MatrixScan to specific use cases where more or less codes had to be tracked. In 6.x it is no longer needed to set this number, instead it is selected automatically depending on the license, use case, and enabled symbologies.
Migrate the Scan UI
Without any further configuration, the default UI renders the Scanning by Scandit logo in the bottom-right corner of the data capture view. To replicate the default look from 5.x, you need to create a viewfinder.
This functionality is only available for barcode capture, but not barcode tracking (MatrixScan).
Enable the Rectangular Viewfinder
- Android
- iOS
- Web
- Cordova
- React Native
- Flutter
- Xamarin iOS
- Xamarin Android
- Xamarin Forms
- .NET iOS
- .NET Android
- Titanium
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
BarcodeCaptureOverlay overlay = new BarcodeCaptureOverlay(barcodeCapture);
RectangularViewfinder viewfinder = new RectangularViewfinder();
overlay.setViewfinder(viewfinder);
dataCaptureView = DataCaptureView.newInstance(this, dataCaptureContext);
dataCaptureView.addOverlay(overlay);
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
let overlay = BarcodeCaptureOverlay(barcodeCapture: barcodeCapture)
let viewfinder = RectangularViewfinder()
overlay.viewfinder = viewfinder
captureView.addOverlay(overlay)
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
const overlay = await SDCBarcode.BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view);
const viewfinder = new SDCCore.RectangularViewfinder();
await overlay.setViewfinder(viewfinder);
await view.addOverlay(overlay);
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
const overlay = Scandit.BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view);
const viewfinder = new Scandit.RectangularViewfinder();
overlay.viewfinder = viewfinder;
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
const overlay = BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view);
const viewfinder = new RectangularViewfinder();
overlay.viewfinder = viewfinder;
view.addOverlay(overlay);
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
var overlay = BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view)
..viewfinder = RectangularViewfinder();
view.addOverlay(overlay);
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
BarcodeCaptureOverlay overlay = BarcodeCaptureOverlay.Create(barcodeCapture, dataCaptureView);
RectangularViewfinder viewfinder = RectangularViewfinder.Create();
overlay.Viewfinder = viewfinder;
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
BarcodeCaptureOverlay overlay = BarcodeCaptureOverlay.Create(barcodeCapture, dataCaptureView);
RectangularViewfinder viewfinder = RectangularViewfinder.Create();
overlay.Viewfinder = viewfinder;
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
BarcodeCaptureOverlay overlay = BarcodeCaptureOverlay.Create(barcodeCapture, dataCaptureView);
RectangularViewfinder viewfinder = RectangularViewfinder.Create();
overlay.Viewfinder = viewfinder;
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
BarcodeCaptureOverlay overlay = BarcodeCaptureOverlay.Create(barcodeCapture, dataCaptureView);
RectangularViewfinder viewfinder = RectangularViewfinder.Create();
overlay.Viewfinder = viewfinder;
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
BarcodeCaptureOverlay overlay = BarcodeCaptureOverlay.Create(barcodeCapture, dataCaptureView);
RectangularViewfinder viewfinder = RectangularViewfinder.Create();
overlay.Viewfinder = viewfinder;
To enable the rectangular viewfinder<ui.RectangularViewfinder>
(previously called the default viewfinder), use the following lines of code:
const overlay = Scandit.BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view);
const viewfinder = new Scandit.RectangularViewfinder();
overlay.viewfinder = viewfinder;
Change the Viewfinder Size
To change the size of the viewfinder using sizes relative to the data capture view (same as in 5.x), you can use the following lines of code:
- Android
- iOS
- Web
- Cordova
- React Native
- Flutter
- Xamarin iOS
- Xamarin Android
- Xamarin Forms
- .NET iOS
- .NET Android
- Titanium
viewfinder.setSize(new SizeWithUnit(new FloatWithUnit(0.8f, MeasureUnit.FRACTION),
new FloatWithUnit(0.4f, MeasureUnit.FRACTION)));
viewfinder.setSize(SizeWithUnit(width: FloatWithUnit(value: 0.8, unit: .fraction),
height: FloatWithUnit(value: 0.4, unit: .fraction)))
viewfinder.setSize(new Scandit.SizeWithUnit(
new SDCCore.NumberWithUnit(0.8, SDCCore.MeasureUnit.Fraction),
new SDCCore.NumberWithUnit(0.4, SDCCore.MeasureUnit.Fraction)
));
viewfinder.setSize(new Scandit.SizeWithUnit(
new Scandit.NumberWithUnit(0.8, Scandit.MeasureUnit.Fraction),
new Scandit.NumberWithUnit(0.4, Scandit.MeasureUnit.Fraction)
));
viewfinder.setSize(new SizeWithUnit(
new NumberWithUnit(0.8, MeasureUnit.Fraction),
new NumberWithUnit(0.4, MeasureUnit.Fraction)
));
viewfinder.setSize(SizeWithUnit(DoubleWithUnit(0.8, MeasureUnit.fraction), DoubleWithUnit(0.4, MeasureUnit.fraction)));
viewfinder.SetSize(new SizeWithUnit
{
Width = new FloatWithUnit { Value = 0.8f, Unit = MeasureUnit.Fraction },
Height = new FloatWithUnit { Value = 0.4f, Unit = MeasureUnit.Fraction }
});
viewfinder.SetSize(new SizeWithUnit
{
Width = new FloatWithUnit { Value = 0.8f, Unit = MeasureUnit.Fraction },
Height = new FloatWithUnit { Value = 0.4f, Unit = MeasureUnit.Fraction }
});
viewfinder.SetSize(new SizeWithUnit
{
Width = new FloatWithUnit { Value = 0.8f, Unit = MeasureUnit.Fraction },
Height = new FloatWithUnit { Value = 0.4f, Unit = MeasureUnit.Fraction }
});
viewfinder.SetSize(new SizeWithUnit
{
Width = new FloatWithUnit { Value = 0.8f, Unit = MeasureUnit.Fraction },
Height = new FloatWithUnit { Value = 0.4f, Unit = MeasureUnit.Fraction }
});
viewfinder.SetSize(new SizeWithUnit
{
Width = new FloatWithUnit { Value = 0.8f, Unit = MeasureUnit.Fraction },
Height = new FloatWithUnit { Value = 0.4f, Unit = MeasureUnit.Fraction }
});
viewfinder.setSize(new ScanditCore.SizeWithUnit(
new ScanditCore.NumberWithUnit(0.8, ScanditCore.MeasureUnit.Fraction),
new ScanditCore.NumberWithUnit(0.4, ScanditCore.MeasureUnit.Fraction)
));
Other Changes
Not applicable for Web.
The short 43 character legacy app keys supported in 4.x and 5.x have been deprecated and are not compatible with 6.0+ anymore. Please contact support to get your new license keys.