ZXing-Orient
ZXing-Orient copied to clipboard
Unable to scan normal barcodes except QR codes.
Could not use the code to scan normal "barcodes" instead of QR codes.
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
2D barcodes' code snippet is working perfectly, only 1Ds' code is not working and barcodes are not getting detected.
can you post some details about your phone model and the code you used if possible
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); }