QR code scanner

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 … Read more

Unity Zxing QR code scanner integration

I was looking for integrating Zxing with vuforia in Unity today. The first thing to do is to download the dll from : https://zxingnet.codeplex.com/ and copy the unity dll into your Plugins folder (which should be in the Assets folder) Then, I managed to found some examples (some of theses is outdated) : http://ydaira.blogspot.fr/2012/09/how-to-decode-qr-codes-using-unity3d.html https://github.com/Redth/ZXing.Net/blob/master/Clients/VuforiaDemo/Assets/VuforiaScanner.cs … Read more

ZXing convert Bitmap to BinaryBitmap

Ok I got it. As Sean Owen said, PlanarYUVLuminaceSource would only be for the default android camera format, which I guess OpenCV does not use. So in short, here is how you would do it: //(note, mTwod is the CV Mat that contains my datamatrix code) Bitmap bMap = Bitmap.createBitmap(mTwod.width(), mTwod.height(), Bitmap.Config.ARGB_8888); Utils.matToBitmap(mTwod, bMap); int[] … Read more

Calling barcode scanner on a button click in android application

I think that “copying” Barcode Scanner and include it in your app might be overloading your projects. You should certainly use the Intent from the Scanner: From here: http://code.google.com/p/zxing/wiki/ScanningViaIntent If the Barcode Scanner is installed on your Android device, you can have it scan for you and return the result, just by sending it an … Read more

zxing onActivityResult not called in Fragment only in Activity

As Martynnw pointed out the issue is to call fragment.startActivityForResult instead of activity.startActivityForResult. So just use next wrapper: import android.content.Intent; import android.support.v4.app.Fragment; import com.google.zxing.integration.android.IntentIntegrator; public final class FragmentIntentIntegrator extends IntentIntegrator { private final Fragment fragment; public FragmentIntentIntegrator(Fragment fragment) { super(fragment.getActivity()); this.fragment = fragment; } @Override protected void startActivityForResult(Intent intent, int code) { fragment.startActivityForResult(intent, code); } … Read more

How to integrate ZXing Library to Android Studio for Barcode Scanning?

You need add the following to your build.gradle file: repositories { mavenCentral() maven { url “http://dl.bintray.com/journeyapps/maven” } } dependencies { // Supports Android 4.0.3 and later (API level 15) compile ‘com.journeyapps:zxing-android-embedded:2.0.1@aar’ // Supports Android 2.1 and later (API level 7), but not optimal for later Android versions. // If you only plan on supporting Android … Read more

How to generate QR code with logo inside it?

You can add your logo it as an Image Overlay like public BufferedImage getQRCodeWithOverlay(BufferedImage qrcode) { BufferedImage scaledOverlay = scaleOverlay(qrcode); Integer deltaHeight = qrcode.getHeight() – scaledOverlay.getHeight(); Integer deltaWidth = qrcode.getWidth() – scaledOverlay.getWidth(); BufferedImage combined = new BufferedImage(qrcode.getWidth(), qrcode.getHeight(), BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = (Graphics2D)combined.getGraphics(); g2.drawImage(qrcode, 0, 0, null); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, overlayTransparency)); g2.drawImage(scaledOverlay, Math.round(deltaWidth/2), Math.round(deltaHeight/2), null); return combined; … Read more