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 Android
To integrate the Scandit SDK into your Android app, follow the simple steps below.
Get the Scandit Barcode Scanner SDK
Choose a plan (e.g., free “Enterprise” or "Community" plan) at http://www.scandit.com/pricing and download the Scandit Barcode Scanner SDK for Android from your account.

Add the SDK to your project
If your project uses Gradle as the build system, the simplest way to integrate the Scandit Barcode Scanner SDK into your app is to use the AAR file contained in the SDK. If you are using Android Studio, but do not use Gradle, we commend to import the Barcode Scanner as a library module (see below). If you are using another IDE, you will have copy the files manually.
Adding the Barcode Scanner SDK for Gradle-Based builds
To add the barcode scanner to your gradle-based Android project, you can use the AAR file contained in the Scandit Barcode Scanner ZIP archive. The AAR file is located in the ScanditSDK subfolder. If your project already has a local flatDir repository, add the AAR to that folder. If you do not have a flatDir repository yet, create a new one in your build.gradle file as illustrated in the code-snippet below:
Add the ScanditBarcodeScanner as a dependency to your build.gradle file:
You can now use the functionality contained in the AAR file in your project.
Adding the Barcode Scanner SDK as a Library Module
If you are using IntelliJ, but do not use gradle for building, you can import the Scandit Barcode Scanner as a library module. Choose "New" → "Module from Existing Sources..". In the file-chooser dialog choose the ScanditSDK/ScanditBarcodeScanner.iml file and click "OK". Now the Barcode Scanner is included as a module inside your project. You need to add the module dependency to your application. Right click on your application module, and click on "Open Module Settings". In the dependencies tab, click on the "+" button and then select "Module Dependency" and add the ScanditBarcodeScanner module.
Manually adding the Barcode Scanner SDK
Copy libs folder
The ZIP file you downloaded contains a folder named libs (ScanditSDK/libs). Create in your Android Studio project the folder jniLibs (at this location /app/src/main/) and copy the content of the lib folder in it.
Copy the raw folder
Copy the raw folder located inside the res folder to the res folder of your Android Studio project.
Add jar
Add the scandit-barcodescanner_x.x.x.jar, which is contained in the jniLibs folder, to Dependencies (right click → "Open Module Settings" →"Dependencies", add "File dependency").

Project tree:

Change minimum SDK version
Starting with Scandit Barcode Scanner SDK 4.0.0 the required Android version is 2.3. If the android:minSdkVersion in your manifest is below 10, change it to 10. If you are still using a Scandit Barcode Scanner version lower than 4.0.0 the required Android version is 2.2 which means the android:minSdkVersion needs to be set to 8.
Grant camera access permissions to your app
If not already done, grant your application the right to access the camera. You will need to add the following in the AndroidManifest.xml of your app. The element needs to be added as a child of the root manifest
element.
Prepare class to receive scanning events
To receive events from the Scandit Barcode Scanner SDK you have to implement the OnScanListener interface. This requires the following steps:
Specify that your class implements the OnScanListener interface.
If your class is an activity called DemoActivity, it looks something like this:
Import the necessary interface by pressing ALT + ENTER.
Implement callback methods
Add the following callback methods to the class (as defined by the interface):
For details on how to use the barcode data returned by the scan session consult the OnScanListener documentation or take a look at one of the included samples.
Instantiate and configure the barcode picker
The scanning process in managed by the BarcodePicker. Before instantiating the picker, you will have to set your Scandit Barcode Scanner application key. The key is available from your Scandit Barcode Scanner SDK account at http://account.scandit.com in the downloads section. The barcode scanning is configured through an instance of scan settings that you pass to the BarcodePicker constructor.
Show the scan UI
Show the scanner to the user. The easiest way to do so is by setting it as the content view of your activity:
For more information on the different ways to add the barcode picker to your view hierarchy, consult Presenting the Scandit Barcode Scanner.
Start the scanner
Starting and stopping should normally happen in the onPause() and onResume() methods of the same activity that contains the picker.
It does not matter whether the picker is the root view of the activity or just a subview in the hierarchy. The camera resource needs to be freed before the activity ends or goes into the background, so stopping the picker in onPause() is a necessity. If it is not stopped your app will keep a lock on the camera which prevents any other app from opening the camera itself.
Run the project
Run your app on your Android device.
Next steps
- Experiment with the extended demo app that allows to set all Scandit Barcode Scanner API options
- Landscape-only Camera Feed Devices
- Presenting the Scandit Barcode Scanner
- Customizing the Scan User Interface
- Configure/Optimize the Barcode Recognition for your Use Case