Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to scan normal barcodes except QR codes. #9

Open
YogeshPatel1994 opened this issue Aug 16, 2016 · 4 comments
Open

Unable to scan normal barcodes except QR codes. #9

YogeshPatel1994 opened this issue Aug 16, 2016 · 4 comments

Comments

@YogeshPatel1994
Copy link

YogeshPatel1994 commented Aug 16, 2016

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

@b1zantine
Copy link
Owner

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

@YogeshPatel1994
Copy link
Author

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

@b1zantine
Copy link
Owner

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

@YogeshPatel1994
Copy link
Author

YogeshPatel1994 commented Aug 18, 2016

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); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants