cordova-plugin-urovo-scanner-spectrum
v1.0.1
Published
Cordova plugin for Urovo barcode scanner devices. Uses native Urovo ScanManager SDK with BroadcastReceiver for hardware trigger scanning.
Maintainers
Readme
cordova-plugin-urovo-scanner-spectrum
Cordova plugin for Urovo barcode scanner devices (PDA handheld terminals).
Uses the native Urovo ScanManager SDK with BroadcastReceiver to capture barcode data when the hardware trigger button is pressed.
Supported Devices
Urovo Android handheld terminals with built-in barcode scanner, including:
- DT50, DT40, DT30 series
- I6310, I6300 series
- Other Urovo PDA devices with
android.device.ScanManagersupport
Installation
cordova plugin add cordova-plugin-urovo-scanner-spectrumOr from a local path:
cordova plugin add /path/to/cordova-plugin-urovo-scanner-spectrumSDK Dependency
This plugin requires the Urovo Platform SDK JAR file (platform_sdk_v4.1.0326.jar).
Download it from the Urovo SDK GitHub repository and place it in:
src/android/libs/platform_sdk_v4.1.0326.jarUsage
The plugin is available at window.plugins.urovo.scanner after device ready.
Check Availability
document.addEventListener('deviceready', function() {
if (window.plugins.urovo.scanner.available) {
console.log('Urovo scanner is available');
}
}, false);Start Scanning
window.plugins.urovo.scanner.start(
function(result) {
console.log('Barcode data: ' + result.data);
console.log('Barcode type: ' + result.type);
console.log('Barcode length: ' + result.length);
console.log('Timestamp: ' + result.timestamp);
},
function(error) {
console.error('Scan error: ' + error.message);
}
);Stop Scanning
window.plugins.urovo.scanner.stop();Scan Result Object
| Property | Type | Description |
|-------------|--------|--------------------------------------|
| data | string | The barcode content |
| type | number | Barcode symbology type ID |
| length | number | Length of the barcode data |
| timestamp | number | Scan timestamp in milliseconds |
Enabled Symbologies
The following symbologies are enabled by default during initialization:
- EAN-13
- EAN-8
- UPC-A
- UPC-E
- Code 128
- Code 39
- Code 93
- QR Code
- DataMatrix
- ITF-25
How It Works
- On
init, the plugin creates aScanManagerinstance and opens the scanner hardware - Symbologies are configured and output mode is set to broadcast intent
- On
start, aBroadcastReceiveris registered to listen forScanManager.ACTION_DECODE - When the hardware trigger is pressed, the scanner decodes the barcode and sends a broadcast
- The
BroadcastReceiverextracts the barcode data and sends it to JavaScript via Cordova callback - On
stop, the receiver is unregistered
Lifecycle Management
- onResume: Re-opens scanner and re-registers receiver if scanning was active
- onPause: Unregisters the broadcast receiver
- onDestroy: Unregisters receiver and closes the scanner
Platform
- Android only (Urovo devices)
License
MIT
