BarcodeScanner
BarcodeScanner copied to clipboard
Phonegap Build - Scanning Window Size
I'm using a Samsung Galaxy Mega 2 - the window for the scanner is very small - anything I can add to this function to increase that size?
Thanks to everyone for your great work!
function scanCode() {
cordova.plugins.barcodeScanner.scan(
function (result) {
$('input[name=equipment_barcode]').val(result.text);
},
function (error) {
alert("Scanning failed: " + error);
}
);
}
Just to be complete. I added this to function ScanCode - but scan window doesn't change. I am using v2.2 of the plugin
var config = {
SCAN_WIDTH: 1920,
SCAN_HEIGHT: 1080
};
Anyone? :)
You can include .jar file which I have created with bigger viewfinder area. https://github.com/bapatel1/zxing-barcode-scanner-bigger-viewfinder
@bapatel1 I get a DEX issue when I build for android with your "update"
@jochem4207 I tried in many placed and also created sample application on that as well but make sure you use correct path and place file as below -
Grab pre-built "com.google.zxing.client.android.captureactivity.jar" file from dist directory & place it under 2 locations in your projects.
(1) yourpoject\plugins\com.phonegap.plugins.barcodescanner\src\android
(2) yourproject\platforms\android\libs\
Build your project and you should have barcode scanner with bigger viewfinder.
@bapatel1 thanks it works now. For everyone with the dex error. Make sure that only one jar file is in the directory! only ONE!
The error was caused because I had the old and new lib there.
I'm sure I'm doing something wrong here... I'm using the phonegap guild and putting the jar in folders as specified is not working. On my PC I created folders from the root of the index and config files are. Then I put the jar in the folders mentioned. Then I zipped everything and uploaded it to phonegap build. The viewfinder size is still small. What am I doing wrong?
This is my file structure:
c:\test\index.html
c:\test\config.xml
c:\test\plugins\com.phonegap.plugins.barcodescanner\src\android
c:\test\platforms\android\libs
In my config I have: gap:plugin name="com.phonegap.plugins.barcodescanner" version="2.2.0" /