BarcodeScanner icon indicating copy to clipboard operation
BarcodeScanner copied to clipboard

Phonegap Build - Scanning Window Size

Open phpprousa opened this issue 9 years ago • 7 comments

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);
      }
   );

}

phpprousa avatar Apr 14 '15 19:04 phpprousa

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
    };

phpprousa avatar Apr 14 '15 20:04 phpprousa

Anyone? :)

phpprousa avatar May 01 '15 16:05 phpprousa

You can include .jar file which I have created with bigger viewfinder area. https://github.com/bapatel1/zxing-barcode-scanner-bigger-viewfinder

itsmebhavin avatar May 01 '15 16:05 itsmebhavin

@bapatel1 I get a DEX issue when I build for android with your "update"

schermafbeelding 2015-05-13 om 10 42 08

jochem4207 avatar May 13 '15 08:05 jochem4207

@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.

itsmebhavin avatar May 13 '15 12:05 itsmebhavin

@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.

jochem4207 avatar May 24 '15 14:05 jochem4207

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" /

narielllc avatar Jul 10 '15 17:07 narielllc