honeywell_scanner 3.1.3+10
honeywell_scanner: ^3.1.3+10 copied to clipboard
This is a plugin to scan barcodes by using [Honeywell](https://www.honeywellaidc.com/products/barcode-scanners) PDA Android devices.
This is a plugin to scan barcodes by using Honeywell PDA Android devices.
About Honeywell SDK #
This plugin uses the native Android SDK available in the Technical Support Downloads Portal for honeywell devices, note that you will need to create an account to download any Honeywell software.
From there you will be able to download the Honeywell_MobilitySDK_Android_vx.xx.zip which is the one used in this plugin.
The Honeywell_MobilitySDK_Android code is located in Software -> Software and tools -> Developer Library -> SDKs for Android
Inside the .zip file you will find sample code, pdf and html documentation and the DataCollection.aar library which is all the necessary documentation to understand and work with the Honeywell_MobilitySDK_Android
Note: You do not have to do anything from the description above to be able to use this plugin, it's just a guide for the ones that need to know the source of truth.
Native library version used: 1.00.00.0102 #
Description #
Supported devices
CN51
CK75
CN75
CN75e
CN80
CN85
Dolphin 75e
Dolphin CT40
Dolphin CT50
Dolphin CT60
EDA50
EDA51
EDA50K
EDA70
Thor VM1A
If your device doesn't show up in the list above, give it a try anyway...
How to use #
First
Run this command:
flutter pub add honeywell_scanner
This will add honeywell_scanner
to your pubspec.yaml dependencies like:
honeywell_scanner: ^latest_version
Then run flutter pub get
to download the library sources to your pub-cache.
Second
Copy the honeywell folder which is inside the example code sources at:
.../your-flutter-sdk/.pub-cache/hosted/pub.dartlang.org/honeywell_scanner-x.x.x+x/example/android/honeywell
into your android project module which is going to use this plugin. This step is necessary and crucial because the Honeywell Android library is a bundle .aar which has to be referenced as a project library.
Third
Add this include ':honeywell'
to your settings.gradle
in your android project module to allow the plugin to locate the honeywell.aar library.
Fourth
Add tools:replace="android:label"
to your AndroidManifest.xml, this is required because the honeywell.aar library defines an android:label="@string/app_name"
which conflicts with your project's label resulting in a Manifest merger failed error
Fifth
To use the honeywell_scanner plugin just:
- Instantiate:
HoneywellScanner honeywellScanner = HoneywellScanner();
- Set the ScannerCallBack listener:
honeywellScanner.setScannerCallBack(this);
- Override the ScannerCallback methods
@override
void onDecoded(String result) {
setState(() {
scannedCode = result;
});
}
@override
void onError(Exception error) {
setState(() {
scannedCode = error.toString();
});
}
- Setting properties. By default honeywell_scanner sets properties to support all code formats from
CodeFormat
enum, it also sets the trigger control property toautoControl
and disables browser launching when scanning urls. However you can set any property you want by using thehoneywellScanner.setProperties(properties)
in case you need some specific behavior from the scanner. Properties are represented as aMap<String, dynamic>
, so for instance if you want the scanner only scans 1D codes and you want the scanned EAN-13 bar codes to include the last digit (the check digit) and want the scanned Codabar bar codes to include the start/stop digits; then you must set it on properties like:
List<CodeFormat> codeFormats = CodeFormatUtils.ALL_1D_FORMATS;
Map<String, dynamic> properties = {
...CodeFormatUtils.getAsPropertiesComplement(codeFormats), //CodeFormatUtils.getAsPropertiesComplement(...) this function converts a list of CodeFormat enums to its corresponding properties representation.
'DEC_CODABAR_START_STOP_TRANSMIT': true, //This is the Codabar start/stop digit specific property
'DEC_EAN13_CHECK_DIGIT_TRANSMIT': true, //This is the EAN13 check digit specific property
};
honeywellScanner.setProperties(properties);
IMPORTANT: To know and understand the full list of supported properties you may check the Honeywell SDK documentation (to get SDK documentation read the About Honeywell SDK at the beginning of this README). Anyway you can check a quick documentation in the doc folder on this plugin where you can find the BarcodeReader.html explaining all about barcode reader including properties and the BarcodeReaderProperties.java where you can find all the property values you can set.
- Start scanner listener, at this point the app will be listening for any scanned code when you press the physical PDA button to scan something:
honeywellScanner.startScanner();
- Stop scanner listener, this will release and close the scanner connection:
honeywellScanner.stopScanner();
- You can also do a
scanner.pauseScanner()
orscanner.resumeScanner()
depending on your app life cycle state.
Note: #
it's recommended to check the example code for a better idea of how to work with this plugin.