Run the Scandit Samples

When you download the Scandit Barcode Scanner SDK, it comes with six demos:

  • SimpleSample: shows how to use the barcode scanner in a stand-alone activity.
  • ExtendedSample: allows the user to configure the barcode scanner as well as the UI from the application itself.
  • MatrixScanSample: shows how to use MatrixScan.
  • BatchModeScanSample: shows how to implement aim-and-scan or scan-and-confirm, to precisely select a barcode among many others.
  • ViewBasedMatrixScanSample: shows how to implement view overlays on top of a barcode with MatrixScan.
  • GeneratorSample: shows how to use our barcode generator.

This guide shows you how to run these sample applications. It is assumed that you have a recent version of Android studio installed on your development machine. These instructions do not work IntelliJ or other IDEs.

To build and run the Scandit demo project, perform the following four steps.

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.

Download page


Open demo project in Android Studio

Unpack the downloaded ZIP file. In Android Studio, select “File” → “Open..”. Select the Samples folder contained in the ZIP file and click "OK".

Set License key

You will have to set your license key in the sample projects. Sign in to your account at http://account.scandit.com to look up your license key in the License Key section.

As an example, in the SimpleSampleActivity.java file, locate the sScanditSdkAppKey constant and paste your license key. 

// Enter your Scandit SDK License key here.
// Your Scandit SDK Liocense key is available via your Scandit SDK web account.
public static final String sScanditSdkAppKey = "-- ENTER YOUR SCANDIT LICENSE KEY HERE --";
private final int CAMERA_PERMISSION_REQUEST = 0;
// The main object for recognizing and displaying barcodes.
private BarcodePicker mBarcodePicker;
private boolean mDeniedCameraAccess = false;
private boolean mPaused = true;
private Toast mToast = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ScanditLicense.setAppKey(sScanditSdkAppKey);
// Initialize and start the bar code recognition.
initializeAndStartBarcodeScanning();
}

Locate the sScanditSdkAppKey constant for the project you want to run:

  • For SimpleSample, the sScanditSdkAppKey is located in SimpleSampleActivity
  • For the ExtendedSample, the sScanditSdkAppKey is located in SampleFulLScreenBarcodeActivity
  • For the BatchModeScanSample, sScanditSdkAppKey is located in SampleAimAndScanBarcodeActivity
  • For the MatrixScanSample, sScanditSdkAppKey is located in MatrixScanSampleActivity

Build and run

You can now build and run the demo project on your Android device.

Next steps

Integrate the Scandit SDK into my app