Pregunta

I am working on replacing an expensive set of bespoke bar code readers with a nice and simple android app.

I am calling the zxing package, and am able to read most bar codes, apart from Code 3 of 9 extended, which is the current standard barcode in our business (with over 2000 barcodes already in circulation).

Is there a way of extending the zxing package to include Code 3 of 9 Extended bar codes??

My current code, which opens the google goggles app and successfully displays QR code and most 1D barcodes information via a Toast call, and I have tried explicitly defining which codes to read but have commented that line out as without it, the scanner should read all possible codes (just for testing):

mGetScanButton = (Button) findViewById(R.id.buttonScan);
mGetScanButton.setOnClickListener(new View.OnClickListener() {


        @Override
        public void onClick(View v) {
             Intent intent = new Intent("com.google.zxing.client.android.SCAN");
                //intent.putExtra("SCAN_FORMATS", "CODE_39,CODE_93,CODE_128,DATA_MATRIX,ITF,CODABAR,EAN_13,EAN_8,UPC_A,QR_CODE" );
                startActivityForResult(intent, 0);
        }

});

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == 0) {
        if (resultCode == RESULT_OK) {
            //  The Intents Fairy has delivered us some data!
            String contents = intent.getStringExtra("SCAN_RESULT");
            //code below will be deleted after testing
            //String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
            // Toast call to display code when read
            Toast.makeText(this, contents, Toast.LENGTH_LONG).show();
            // Handle successful scan
        } else if (resultCode == RESULT_CANCELED) {
            // Handle cancel
        }
    }

}

Your assistance is much appreciated, I would prefer not to ask the staff to replace all the bar codes... although this may be required!

Example of Code 39 extended - encoded number = 25

EDIT : My app is actually opening the Google Goggle app rather than the Barcode Scanner app from zxing! I have now installed the correct Barcode Scanner app, and it works. Many thanks all!

¿Fue útil?

Solución

My app is actually opening the Google Goggle app rather than the Barcode Scanner app from zxing! I have now installed the correct Barcode Scanner app, and it works. Many thanks all!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top