更新记录
1.1.0(2026-05-28)
最低系统要求
- Android 5.0+ (API Level 21)
- HBuilderX 3.6.8+
- uni-app 4.0+
平台兼容性
uni-app(4.0)
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| - | √ | - | - | - | - | 5.0 | - | - |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | - | - | - | - | - |
# lg0815-padyssm
Multi-brand PDA scanner callback plugin for uni-app / uni-app x UTS.
Android currently supports:
- Honeywell PDA scanners through Honeywell AIDC (
DataCollection.jar) andAidcManager/BarcodeReader. - UROVO PDA scanners through
android.device.ScanManagerdynamic intent broadcasts.
Unsupported platforms and unsupported Android brands return explicit errors. iOS and Harmony stubs are exported so imports remain stable.
APIs
import {
initScanner,
startScan,
stopScan,
releaseScanner,
getScannerDevice,
isHoneywellDevice,
type ScanResult
} from '@/uni_modules/lg0815-padyssm'
getScannerDevice(options)
Returns the detected brand/manufacturer/model plus normalized scanner support information:
supported: whether the current Android device maps to a supported scanner backend.scannerBrand:honeywell,urovo, orunsupported.source:honeywell-aidc,urovo-scanmanager, orunsupported.
isHoneywellDevice(options)
Compatibility API for existing callers. It keeps Honeywell-only semantics and returns supported === true only on Honeywell devices. New code should prefer getScannerDevice.
initScanner(options)
Detects the current Android PDA brand, initializes the matching scanner backend, and stores options.onScan.
Honeywell initialization creates and configures a Honeywell BarcodeReader, registers barcode and trigger listeners, and claims the scanner.
UROVO initialization creates ScanManager, opens the scanner, reads the configured broadcast action/data key with PropertyID.WEDGE_INTENT_ACTION_NAME and PropertyID.WEDGE_INTENT_DATA_STRING_TAG, switches output to Intent mode, disables keyboard wedge output, registers a dynamic BroadcastReceiver, and reports ready.
ScanResult fields:
data: decoded barcode text.codeId: Honeywell code ID; empty for UROVO.aimId: Honeywell AIM ID; empty for UROVO.timestamp: scanner timestamp for Honeywell, current timestamp string for UROVO.charset: Honeywell charset name; empty for UROVO.source:honeywell-aidcorurovo-scanmanager.brand:honeywellorurovo.
startScan(options) / stopScan(options)
- Honeywell uses
BarcodeReader.softwareTrigger(true/false). Hardware trigger events also callaim,light, anddecodewith the trigger state. - UROVO uses
ScanManager.startDecode()/ScanManager.stopDecode(). Physical trigger scans are received through the registered broadcast receiver.
releaseScanner(options)
Stops scanning, unregisters UROVO broadcast receivers, releases/cleans Honeywell listeners, closes scanner managers/readers, and clears callbacks. The Android implementation also registers an activity-destroy cleanup hook to avoid stale native receivers retaining old uni-app JS callbacks.
Usage Example
import { initScanner, startScan, stopScan, releaseScanner, getScannerDevice, type ScanResult } from '@/uni_modules/lg0815-padyssm'
getScannerDevice({
success: (device) => {
console.log('scanner supported:', device.supported, device.scannerBrand, device.brand, device.model)
}
})
initScanner({
onScan: (result: ScanResult) => {
if (result.data.length > 0) {
console.log('scan data:', result.data)
console.log('source:', result.source, result.brand)
console.log('Honeywell metadata:', result.codeId, result.aimId, result.charset, result.timestamp)
} else {
console.log('scan failed or no-read')
}
},
success: (status) => {
console.log('scanner ready:', status.source, status.brand)
},
fail: (err) => {
console.error(err.errCode, err.errMsg)
}
})
// Optional software trigger.
startScan({
fail: (err) => console.error(err.errMsg)
})
stopScan({})
// Call when leaving the page/module.
releaseScanner({})
Android Integration
Files changed in this plugin:
utssdk/interface.uts: typed multi-brand scanner API surface.utssdk/unierror.uts: plugin-specificlg0815-padyssmerrors.utssdk/app-android/index.uts: Honeywell AIDC and UROVO ScanManager implementation.utssdk/app-android/config.json: Android min SDK.utssdk/app-android/libs/DataCollection.jar: Honeywell AIDC SDK.utssdk/app-android/libs/platform_sdk_v4.0.0802.jar: vendor platform SDK copied fromcds_uni_plat_apkforandroid.device.*APIs.utssdk/app-android/libs/BarcodeAPI_V1_1_33.jar: barcode/vendor SDK copied fromcds_uni_plat_apk.utssdk/app-ios/index.uts: explicit unsupported implementation.utssdk/app-harmony/index.uts: explicit unsupported implementation.readme.md: this usage and verification guide.
Android config requests:
minSdkVersion:21
The host application's Android manifest should include:
<uses-permission android:name="com.honeywell.decode.permission.DECODE" />
<uses-permission android:name="android.permission.VIBRATE" />
UROVO callback support uses a dynamic runtime receiver, so no static <receiver> manifest entry is required when using the implemented ScanManager path.
Do not rely on this plugin's config.json to merge permissions automatically across all HBuilderX versions.
Self-Test Flow
- Open the uni-app project in HBuilderX.
- Build/run to a real Honeywell Android PDA and a real UROVO Android PDA. Emulator, iOS, Harmony, and unsupported Android devices are expected to report unsupported or no hardware scanner.
- Confirm the APK includes
DataCollection.jar,platform_sdk_v4.0.0802.jar, andBarcodeAPI_V1_1_33.jarfrom the plugin libs. - On app startup or page entry, call
getScannerDeviceand verifysupported === truewithscannerBrand === 'honeywell'orscannerBrand === 'urovo'on matching hardware. - Call
initScannerand verify thesuccesscallback reports{ ready: true, source: 'honeywell-aidc', brand: 'honeywell' }on Honeywell or{ ready: true, source: 'urovo-scanmanager', brand: 'urovo' }on UROVO. - Press the physical scan trigger and scan a Code 128 or QR code. Verify
onScanreceives non-emptydataand the expectedsource/brand. - Call
startScanandstopScanfrom a button to verify software trigger operation: Honeywell should usesoftwareTrigger, UROVO should usestartDecode/stopDecode. - Leave the page or close the module and call
releaseScanner; re-enter and callinitScanneragain to verify resources can be claimed after cleanup and UROVO does not duplicate callbacks. - Test a bad/no-read scan and confirm the callback/error path does not crash.
Real-Device Verification Requirements
Honeywell AIDC classes are supplied by DataCollection.jar, but scanner availability depends on Honeywell device firmware and scanner service. UROVO classes are supplied by vendor SDK jars, but scanner behavior depends on UROVO firmware and scan service settings. Final verification must be performed on real Honeywell and UROVO PDA hardware.
HBuilderX Compile Caveat
The Android implementation is written in UTS using Java imports, Android BroadcastReceiver, and native listener classes following DCloud UTS Android documentation. If HBuilderX reports missing android.device.* classes, verify the copied UROVO/vendor jars are packaged into the Android custom base.

收藏人数:
购买源码授权版(
试用
赞赏(0)
下载 0
赞赏 0
下载 12072954
赞赏 1917
赞赏
京公网安备:11010802035340号