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)
 

Optional Checksums

static final int CHECKSUM_MOD_NONE
 
static final int CHECKSUM_MOD_MOD_10
 
static final int CHECKSUM_MOD_MOD_11
 
static final int CHECKSUM_MOD_MOD_1010
 
static final int CHECKSUM_MOD_MOD_1110
 

Recognition Mode

static final int RECOGNITION_MODE_TEXT
 
static final int RECOGNITION_MODE_CODE
 

Camera Facing Direction

static final int CAMERA_FACING_BACK
 
static final int CAMERA_FACING_FRONT
 

Camera Switch Button Visibility

static final int CAMERA_SWITCH_NEVER
 
static final int CAMERA_SWITCH_ON_TABLET
 
static final int CAMERA_SWITCH_ALWAYS
 

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
final int CHECKSUM_MOD_NONE
static

No optional checksum.

final int CHECKSUM_MOD_MOD_10
static

Modulo 10 checksum.

final int CHECKSUM_MOD_MOD_11
static

Modulo 11 checksum.

final int CHECKSUM_MOD_MOD_1010
static

Two modulo 10 checksums.

final int CHECKSUM_MOD_MOD_1110
static

A modulo 11 and a modulo 10 checksum.

final int RECOGNITION_MODE_TEXT
static

Text recognition.

final int RECOGNITION_MODE_CODE
static

Barcode/2d code recognition.

final int CAMERA_FACING_BACK
static

Default camera orientation - facing away from user.

final int CAMERA_FACING_FRONT
static

Camera facing towards user.

final int CAMERA_SWITCH_NEVER
static

The camera switch button is always hidden.

final int CAMERA_SWITCH_ON_TABLET
static

The camera switch button is shown on tablet devices with front and back cameras.

final int CAMERA_SWITCH_ALWAYS
static

The camera switch button is shown on all devices that have front and back cameras.