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:
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.
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.
Go to Settings. Select System Apps. Tap on Camera. Then toggle to enable Scan QR codes.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With