I would like to create a QR code scanner in my app.
I went through the zxing ,but I could not understand it. I am interested in QR codes only.
All help is highly appreciated.
To scan a QR Code with Google Screen Search, you don't need an app. You can use the following steps to scan a QR Code: Point your camera at the QR Code. Hold down the “Home” button and swipe up to reveal the options at the bottom.
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.
To scan QR code on Android, open the Camera app and position the QR code within the frame. If that doesn't work, you can use the Google Lens feature in the Google Search app.
Kaspersky QR Scanner is one of the best free third-party scanning apps for iOS and Android. Developed by the cybersecurity experts at Kaspersky, it does what you'd expect a QR scanning app from a cybersecurity company to do: scan for unsafe and malicious QR codes.
Place a copy of the com.google.zxing.client.* source packages into your project. You can start the zxing scanning activity like this:
Intent intent = new Intent(this, CaptureActivity.class);
startActivityForResult(intent, 0);
In the same activity that you invoked the CaptureActivity in you can handle the result when the scan completes with the following onActivityResult method:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (data != null) {
String response = data.getAction();
if(Pattern.matches("[0-9]{1,13}", response)) {
// response is a UPC code, fetch product meta data
// using Google Products API, Best Buy Remix, etc.
} else {
// QR codes - phone #, url, location, email, etc.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(response));
startActivity(intent);
}
}
}
Hope this helps.
I know this is an old question, but thought someone might find this useful.
I recently released a qr reader app, and ZXing really is the go-to library on Android. However, I found working with a copy of the source of ZXing project difficult. There is already a library that handles the ZXing core, and even optimizes it for custom usage.
Try zxing-android-embedded:
I put a guide on this post.
Hope this helps!
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