Installation
This page describes how to integrate the Scandit Data Capture SDK into your Titanium project.
Prerequisites
- The latest stable version of the Titanium SDK and other related tools and dependencies.
- A project with minimum iOS deployment target of 14.0 or higher. Or an Android project with target SDK version 23 (Android 6, Marshmallow) or higher.
- A valid Scandit Data Capture SDK license key. You can sign up for a free test account.
Android devices running the Scandit Data Capture SDK need to have a GPU or the performance will drastically decrease.
Get a License Key
If you have a paid subscription, please reach out to Scandit Support if you need a new license key.
Add the SDK
Currently we support adding the Scandit Data Capture SDK Titanium modules to your project in two ways. The simplest way is to use the npm registry, alternatively you can manually download the modules and add them to your project.
Create a new project
If you do not have a Titanium project yet that you’ll use, you should create a new one.
ti create -t app -n <PROJECT_NAME>
Add the SDK via npm
To add our plugins from the npm registry, you can run these commands from your project’s root folder. In the following snippet we’re adding ScanditBarcodeCapture API
npm install scandit-titanium-datacapture-core
npm install scandit-titanium-datacapture-barcode
You can also specify a version @<version>
.
Add the SDK manually
You need to declare the modules you want to use in the app’s tiapp.xml file, e.g. for barcode capture, declare the scandit-titanium-datacapture-barcode module:
<modules>
<module platform="android">com.scandit.ti.datacapture.core</module>
<module platform="android">com.scandit.ti.datacapture.barcode</module>
<module platform="iphone">com.scandit.ti.datacapture.barcode</module>
<module platform="iphone">com.scandit.ti.datacapture.core</module>
</modules>
After you download the archive containing all the modules from the Scandit Dashboard, unzip the archive.
It includes the available Titanium modules, including the scandit-titanium-datacapture-core
module that all other modules depend on. Now you need to copy the the required modules to the root folder of the application.
Sticking with the current example, it means that you need:
- The barcode module for Android.
- The core module for Android.
- The barcode module for iOS.
- The core module for iOS.
Additional Information
Camera Permissions
When using the Scandit Data Capture SDK you will want to set the camera as the frame source for various capture modes. On Android, you have to request camera permissions in your own application before starting scanning. To see how you can achieve this, take a look at our samples.
Remember that, if you want to use the camera as the frame source for barcode capture you need to set the “Privacy - Camera Usage Description” field in the Info.plist file for iOS.