Extract data from a QR Code after reading

Asked

Viewed 1,335 times

1

I have an app in the Play Store developed for a non-profit NGO, where tax coupons are donated and stored in an Excel spreadsheet each record, where it contains:

  • CNPJ
  • Date of Purchase
  • COO
  • Note value

With QR Code being a trend for these coupons as well, I need help getting my app to extract this information when reading QR Code.

In the application there is a button that enables the QR Code, where it runs the Barcode Scanner. Currently my code is like this:

// Botão para abrir câmera e usar o QR Code (Irá abrir a Store para baixar um app nativo)
    btnQR = (Button) findViewById(R.id.btnQR);
    btnQR.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            IntentIntegrator integrator = new IntentIntegrator(MainActivity.this);
            integrator.addExtra("SCAN_WIDTH", 640);
            integrator.addExtra("SCAN_WEIGHT", 480);
            integrator.addExtra("SCAN_MODE", "QR_CODE_MODE,PRODUCT_MODE");
            integrator.addExtra("PROMPT_MESSAGE", "Escaneie o QR Code");
            integrator.initiateScan(IntentIntegrator.PRODUCT_CODE_TYPES);
        }
    });

The above code enables the reader.

I need help with this part on. I am open manual and saw that within the QR Code there is also Hash QR Code, and that the information is encrypted in SHA-1, and should be in HEXADECIMAL.

My case would be to read this encoding, and decode, causing the information I need (described at the beginning) to automatically fill in.

Thank you in advance.

  • Maybe the documentation will help. I think it’s in the result. https://zxing.github.io/zxing/apidocs/com/google/zxing/integration/android/IntentIntegrator.html

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.