Barcode Scanner In Cordova
Posted By : Karan Bhardwaj | 23-Jan-2015
Basic Description:
Barcodes is basically used to provide asset & security tracking, theft deterrence. In general we can say that barcode reduces liability.Few years ago barcode scanning is done only through barcode reader devices and some thing like optical scanners but now we can scan barcode through our mobile devices, tablets, etc.Now i am representing that how create application to scan barcode.
In this I am using barcode Scanner plugin in Cordova to create barcode scanner application.
Supported Types Of Barcode
Support of Types Barcode Scanning Varies From Platform to Platform (Android,iOS,blackberry).
- QR_CODE
- DATA_MATRIX
- UPC_E
- UPC_A
- EAN_8
- EAN_13
- CODE_128
- CODE_39
- CODE_93
- CODABAR
- ITF
- RSS14
- PDF417
- RSS_EXPANDED
Installation :
Using Terminal go in your project directory, from inside your Cordova project you have to enter the following command.
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
Working :
For Scanning bar through your Device Camera you have to use this "cordova.plugins.barcodeScanner.scan". In this .scan is the object created by Cordova Barcode Scanner plugin to scan bar code.
function scanCode() { cordova.plugins.barcodeScanner.scan(function(result) { alert("We got a barcode\n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled); }, function(error) { alert("Scanning failed: " + error); }); }
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Karan Bhardwaj
Karan is expert in JavaScript, JQuery, Phonegap, Java, Groovy and Grails, SpringBoot, Kurento, MongoDB, NodeJs, Wowza, FFmpeg and Kaltura.