Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working QR code scanner for PhoneGap

I have successfully followed this thread
Phonegap 3.0.0: BarcodeScanner Plugin

But it seems like it cannot scan Qr Code. Here is the screen shot from phone:

enter image description here

I have tried scanning a barcode image and it works fine. But not with QR images.
Any idea?

EDIT

    var scanner = cordova.require("com.phonegap.plugins.barcodescanner.barcodescanner");

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

EDIT 2
DuuhhH!!! The problem was the QR image, it has no margin as Sean Owen said.

like image 882
fiberOptics Avatar asked Oct 09 '14 16:10

fiberOptics


People also ask

Can ZXing scan QR code?

On click of button_scan_qr_code , CaptureActivity will start scanning using default camera. Once it scans any QR code, it sends back the result to onActivityResult the MainActivity . ZXing also provides online QR Code Generator. Enter the required fields, generate and scan it to get the results.

How do I run a QR scanner?

Go to Settings. Select System Apps. Tap on Camera. Then toggle to enable Scan QR codes.

How do I scan a QR code from a website on my phone?

Step 2: Scan the QR code On your compatible Android phone or tablet, open the built-in camera app. Point the camera at the QR code. Tap the banner that appears on your Android phone or tablet. Follow the instructions on the screen to finish signing in.


1 Answers

Copying from my comment as it seems to be the answer: That QR code does not have a margin, which is probably why it won't scan.

like image 171
Sean Owen Avatar answered Oct 23 '22 15:10

Sean Owen