scanditsdk Class Reference

Inherits TiViewProxy.

Barcode Picker Setup

Initialize and prepare the barcode picker, control standby state and set overlay

static String appKey
 
static int cameraFacingPreference
 
static scanditsdkView createView ()
 
static ScanCase createScanCase (Map< String, Object > settings)
 

Detailed Description

Proxy for the ScanditSDK module, needed to set the app key and create the actual scanditsdkView which can then be added to a view hierarchy.

Since
1.0.0

Minimal example to set up the barcode picker and start scanning.

// Load the Scandit SDK module.
var scanditsdk = require("com.mirasense.scanditsdk");
// First set the app key and which direction the camera should face.
scanditsdk.appKey = "-- ENTER YOUR SCANDIT LICENSE KEY HERE --";
scanditsdk.cameraFacingPreference = 0; // Back camera
// Instantiate the Scandit SDK Barcode Picker view.
var picker = scanditsdk.createView({
width:"100%",
height:"100%"
});
// Initialize the barcode picker.
picker.init();
// Set callback functions for when scanning succeedes and for when the scanning is canceled.
picker.setSuccessCallback(function(e) {
alert("success (" + e.symbology + "): " + e.barcode);
});
// startScanning() has to be called after the window is opened.
picker.startScanning();

Member Function Documentation

static scanditsdkView createView ( )
static

Creates the actual view that can be added to a view hierarchy.

Returns
a new view
Since
1.0.0
See also
scanditsdkView

This function is inherited from TiViewProxy and is the standard way to retrieve a module's view.

static ScanCase createScanCase ( Map< String, Object >  settings)
static

Creates a new scan case instance.

Returns
a new scan case.

While it's possible to create multiple scan case instances, it is recommend to only have one scan case per application.

Since
5.1.0
See also
ScanCase
Parameters
settingsproperties to be set on the scan case. This parameter can be omitted.

Member Data Documentation

String appKey
static

Your Scandit SDK App Key.

You always have to statically set the app key before requesting the view.

Since
4.4.3
int cameraFacingPreference
static

A preference for which way the camera should face when first creating the view (0 for backward (default) camera, 1 for front camera).

Since
4.4.3