ZXing-Orient icon indicating copy to clipboard operation
ZXing-Orient copied to clipboard

Unable to scan normal barcodes except QR codes.

Open YogeshPatel1994 opened this issue 8 years ago • 4 comments

Could not use the code to scan normal "barcodes" instead of QR codes.

YogeshPatel1994 avatar Aug 16 '16 08:08 YogeshPatel1994

By default it supports only certain types of codes.

Start the activity like this to use 1D bar codes alone

new ZxingOrient(MainActivity.this).initiateScan(Barcode.ONE_D_CODE_TYPES);

To use 2D barcodes alone

new ZxingOrient(MainActivity.this).initiateScan(Barcode.TWO_D_CODE_TYPES);

To detect specific barcodes types only

new ZxingOrient(MainActivity.this)
    .initiateScan(new Collections.unmodifiableList(Arrays.asList("QR_CODE", "DATA_MATRIX","UPC_A", "UPC_E", "EAN_8")));

For other barcode types have a look into Barcode.java

b1zantine avatar Aug 16 '16 11:08 b1zantine

2D barcodes' code snippet is working perfectly, only 1Ds' code is not working and barcodes are not getting detected.

YogeshPatel1994 avatar Aug 16 '16 12:08 YogeshPatel1994

can you post some details about your phone model and the code you used if possible

b1zantine avatar Aug 17 '16 04:08 b1zantine

As mentioned in the code given here, I made a switch case like this for 1D scan: switch (v.getId()){ case R.id.button_1: new ZxingOrient(HomeActivity.this) .setIcon(R.drawable.ic_launcher) .setInfo("Scans 1D barcodes") .initiateScan(Barcode.ONE_D_CODE_TYPES); break; case R.id.button_2: new ZxingOrient(HomeActivity.this) .setIcon(R.drawable.ic_launcher) .setInfo("Scans 2D barcodes") .initiateScan(Barcode.TWO_D_CODE_TYPES); }

YogeshPatel1994 avatar Aug 18 '16 06:08 YogeshPatel1994