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
This guide shows how to use the unified API for scanning barcodes in your application.
Get the Scandit Barcode Scanner
The unified barcode scanner API is available as a NuGet package and can easily be installed via NuGet.org. For details on how to add a NuGet package to your project, take a look at the guides for Xamarin Studio, or Visual Studio. Search for the Scandit.BarcodePicker.Unified package and add it to your project. You will need to add a reference to the portable class library where your barcode scanning logic is going to be implemented, and to the iOS/Android and Windows applications. The latter is required to also include the platform-specific portion of the code into your app.
Add the barcode scanner namespace to easily access its classes
If you don't want to type the whole namespace each time when using the scanner you should add a using directive at the top of the class you will use the scanner in:
Set the app key
Sign in to your account at http://account.scandit.com to look up your app key in the Download section.

The application key must be set before you use the barcode picker for the first time. Typically you will put this code into the Page constructor that uses the barcode picker:
Add code to start the scanning process
In the unified API, the barcode picker is a singleton whose instance will be different depending on the platform the code runs on. To scan a barcode, these 3 steps are neccessary. 1. configure the barcode picker, 2. register a DidScan delegate, 3. start the scanning. These steps are shown in the code sample below:
Add code to handle the scanning event
To be notified when a barcode is scanned, add a delegate to the DidScan event of the barcode picker. A possible implementation of such a delegate looks like this:
Careful: The delegate is invoked on a picker-internal queue. To perform any UI work, you must dispatch to the main UI thread.
Next steps
- Experiment with the extended demo app that allows to set all Scandit Barcode Scanner API options
- Presenting the Scandit Barcode Scanner
- Customizing the Scan User Interface