0

I read on this article how scan Barcodes with Embedded Weight function works, but I wonder if zxing library can make this scan or just scan the barcode as total and read it with the full EAN-13 numbers only?

1 Answers1

0

Below is the Android JAVA implementation details if you just want to scan EAN_13.

Hope this helps. Thanks

IntentIntegrator intentIntegrator = new IntentIntegrator(this); // where this is activity
intentIntegrator.initiateScan(Collections.singleton(IntentIntegrator.EAN_13));

Code to handle the response received after scanning.

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
        super.onActivityResult(requestCode, resultCode, intent);
        if (requestCode == IntentIntegrator.REQUEST_CODE) {
            if (resultCode == RESULT_OK) {
                String contents = intent.getStringExtra("SCAN_RESULT");
                String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
                // Handle successful scan
                Toast toast = Toast.makeText(this, "Content:" + contents + " Format:" + format, Toast.LENGTH_LONG).show();
            } else if (resultCode == RESULT_CANCELED) {
                // Handle cancel
                Toast toast = Toast.makeText(this, "Scan was Cancelled!", Toast.LENGTH_LONG).show();

            }
        }
    }

You can find detailed implementation details on how to import and use the library in following link.

https://github.com/journeyapps/zxing-android-embedded