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 ()
 

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 APP 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();
Examples:
app.js.

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.

Examples:
app.js.

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
Examples:
app.js.
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
Examples:
app.js.

The documentation for this class was generated from the following file:
  • ComMirasenseScanditsdkProxyDocumentation.java