Google Mobile Vision API QR Code and Barcode Tutorial – Android

Android

Video is ready, Click Here to View ×


A very detailed and step by step Android tutorial for Google Mobile Vision API QR code and Barcode detection.
By using this tutorial any one can develop any barcode reader or QR code reader Android app.

Barcodes formats can be read :

1D barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF, Codabar

2D barcodes: QR Code, Data Matrix, PDF-417, AZTEC

Mobile vision API can automatically parses QR Codes, Data Matrix, PDF-417, and Aztec values, for the following supported…

23 thoughts on “Google Mobile Vision API QR Code and Barcode Tutorial – Android

  1. For those of you who may get a black screen when it opens to the barcode scanner simply replace the surfaceCreated method with
    @Override
    public void surfaceCreated(SurfaceHolder holder) {

    if (ActivityCompat.checkSelfPermission(BarCodeScanner.this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
    // TODO: Consider calling
    // ActivityCompat#requestPermissions
    // here to request the missing permissions, and then overriding
    // public void onRequestPermissionsResult(int requestCode, String[] permissions,
    // int[] grantResults)
    // to handle the case where the user grants the permission. See the documentation
    // for ActivityCompat#requestPermissions for more details.
    ActivityCompat.requestPermissions(BarCodeScanner.this, new String[]{Manifest.permission.CAMERA},
    MY_PERMISSION_REQUEST_CAMERA);
    return;
    }
    You will need to create a variable called MY_PERMISSION_REQUEST_CAMERA
    private static final int MY_PERMISSION_REQUEST_CAMERA = 2569;
    2569 can be any int less than 65536
    It will ask for the camera permission, then back out of the activity and reenter and it should work

Leave a Reply

Your email address will not be published. Required fields are marked *