0

I try to use Zxing to decode 128C (Code set C) barcodes. I have success when I read other types like QR_CODE, UPC_A.

These are barcodes that I trying to read:

enter image description here

enter image description here

Is possible read 128C barcodes (Not CODE 128 pure) with Zxing ?

1 Answer 1

1

Short aswer, yes, it should is possible. As 128C just is a subset of 128. Can scan the codes, might take a few seconds. And have XZing working in a app.

You have found out that 128 is supported, now you got to make an translation. 128C takes the same input as 128, just turns out numbers. So you could make a translation from the data you get back, and turn it into 128C. Check the second link for how that translates.

https://github.com/zxing/zxing/blob/master/README.md

https://en.wikipedia.org/wiki/Code_128

Get the needed classes from the XZing github, put them in a package in the java part of your project. I used only 2:

  • IntentIntegrator
  • IntentResult

Here is how it is initiated in my code:

/** * Method called to intiate the scan (it's linked to a button) */ public void doScan(View view) { IntentIntegrator scanIntegrator = new IntentIntegrator(this); scanIntegrator.initiateScan(); } // when you click the Scan Bar Code button public void onActivityResult(int requestCode, int resultCode, Intent intent) { IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent); if (scanningResult != null) { // we have a result String scanContent = scanningResult.getContents(); // set the content of the scan. String scanFormat = scanningResult.getFormatName(); // set the type of scan. // You will want to put this data somewhere else, globals, etc. } else { toast("No scan data received!"); // call to make a toast } } 
Sign up to request clarification or add additional context in comments.

5 Comments

I tried with Zxing but I received a NotFoundException. I believe it is something in the ZXing algorithm. Can you read these barcodes in your app ?
The code generated here works: (tested 128 and 128C) example.barcodephp.com/html/BCGcode128.php
Does your app crash at startup? Mine needed the barcode scanner installed on the app to scan. / I'll post how I did mine.
Just tried the barcodes you have provided, I can scan them. So that works. Time for some sample code. Good luck!
Glad to help! Have fun!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.