This plugin enables the ability to scan and decode a barcode. It uses the open source BarcodeScanner plugin and has upgraded it to use the 3.0.0 version of the ZXing barcode image processing library on the Android platform and on iOS corrects some warnings associated with deprecated code and fixes an issue where it is not possible to dismiss an alert dialog in a callback method.
There are a lot of acronyms in this area. The following are some related topics, links and a few brief points on how they compare or relate to barcodes.
UPC or Universal Product Code is a standard way that one dimensional barcodes are encoded. It represents a 12 digit number. The site http://www.barcoding.com/upc/#.U3Di1_ldUtI can be used to generate a sample UPC.
QR or Quick Response code is a two dimension bar code. It can represent numbers and text such as a URL or a person's contact information. The ZXing project provides a QR generator and decoder.
RFID or Radio-Frequency Identification is used to transfer data wireless for the purposes of identification. RFID tags can be used with barcodes. For example a pallet may be identified by an RFID tag but each item in the pallet may contain a barcode. Barcodes are less expensive than RFID tags. RFID tags can be read hundreds at a time whereas barcodes must be scanned one at a time. Barcodes can be sent via email such as movie ticket or flight ticket and read off of a screen of mobile device. A RFID chip does not require a line of sight to the reader. Each RFID chip has a unique identifier. Many passports include an RFID chip as do electronic toll transponders. An RFID tag can typically hold a few kilobytes of data.
NFC or Near Field Communication is a set of standards for two devices in close proximity to establish radio communication based on RFID. NFC can be used to bootstrap more capable wireless connections such as Bluetooth. It is also used for mobile payment such as PayPass. It enables two way communication. iOS does not support NFC. On Google Nexus devices the feature is called Android Beam. On Samsung devices it is known as S-Beam. NFC has a lower transfer rate, requires less power, and sets up more quickly than Bluetooth.
Bluetooth is a wireless technology for exchanging data over short distances similar to NFC.
iBeacon is an indoor positioning system used by Apple Inc. It uses Bluetooth Low Energy.
For additional details on the Barcode Scanner plugin see the JavaScript file in a project that includes this plugin at
project_name\plugins\com.sap.mp.cordova.plugins.barcodescanner\www\barcodescanner.js
or the JS Documentation at Kapsel Barcode Scanner API Reference.
The following steps will demonstrate an example of using this plugin. Note, the Kapsel Barcode Scanner requires the Android SDK Build-tools to be >= 19.0.3 otherwise an error of java.lang.NoClassDefFoundError may occur when calling scan.
cordova -d create C:\Kapsel_Projects\BarcodeScannerDemo com.mycompany.barcodescanner BarcodeScannerDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"
cd C:\Kapsel_Projects\BarcodeScannerDemo
cordova -d platform add android
cordova -d create ~/Documents/Kapsel_Projects/BarcodeScannerDemo com.mycompany.barcodescanner BarcodeScannerDemo "{\"plugin_search_path\":\"/Users/i826567/SAP/MobileSDK3/KapselSDK/plugins/\"}"
cd ~/Documents/Kapsel_Projects/BarcodeScannerDemo
cordova -d platform add ios
cordova -d plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
cordova -d plugin add com.sap.mp.cordova.plugins.barcodescanner
or
cordova -d plugin add https://github.com/wildabeast/BarcodeScanner
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_share"
android:title="@string/menu_share"
android:icon="@android:drawable/ic_menu_share"
android:orderInCategory="1"
android:showAsAction="withText|ifRoom"/>
<item android:id="@+id/menu_encode"
android:title="@string/menu_encode_vcard"
android:icon="@android:drawable/ic_menu_sort_alphabetically"
android:orderInCategory="2"
android:showAsAction="withText|ifRoom"/>
</menu>
cordova -d prepare
It is also possible to use the SAPUI5 sap.ndc.BarCodeScannerButton. This is part of the sap.ndc package which has controls with native device capabilities.
Here is a simple example index2.html that makes use of this control and a few screenshots demonstrating how it looks.
Note if the Barcode scanner is unable to successfully complete the scan, the following dialog appears to enable manual entry.
Another example is available at BarCodeScannerButton.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
40 | |
25 | |
17 | |
14 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 |