ramya avatar image
ramya asked parag commented

2D barcode scanner not working with BarcodeScanner


2D barcode scanner not working with BarcodeScanner. But its working fine with Register app and 1D barcode scanner.

This is the code we are using

mBarcodeScanner = new BarcodeScanner(this);
Bundle extras = new Bundle();
extras.putBoolean(Intents.EXTRA_LED_ON, false);
extras.putBoolean(Intents.EXTRA_SCAN_1D_CODE, true);
extras.putBoolean(Intents.EXTRA_SHOW_PREVIEW, false);
extras.putBoolean(Intents.EXTRA_SCAN_QR_CODE, true);
extras.putBoolean(Intents.EXTRA_SHOW_MERCHANT_PREVIEW, false);
extras.putBoolean(Intents.EXTRA_SHOW_CUSTOMER_PREVIEW, false);
extras.putBoolean(Intents.EXTRA_SHOW_CLOSE_BUTTON, false);
extras.putBoolean(Intents.EXTRA_SHOW_LED_BUTTON, false);
extras.putBoolean(Intents.EXTRA_START_SCAN, true);
extras.putInt(Intents.EXTRA_SCANNER_FACING, 0);

Can you please check it. Is anything we have to add?

clover developer communitybarcode scanner
scanner.jpg (271.7 KiB)
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered parag commented

BarcodeScanner is for the Clover built-in (camera-based) scanner, not external USB scanners like in your image.

Also, you passed EXTRA_SCAN_1D_CODE, which means "scan only 1d barcodes". If you want both 1d and 2d don't set that. Anyway, for external USB scanners this has no effect and you'll need to refer to the scanner's documentation to understand how to configure it.

Finally, we don't support all external barcode scanners. I'd need to know the USB vendor and product ID to tell you definitively if that's a supported scanner. If you're using a linux-based system you can plug it in and do "lsusb" to find out.

If you connect an unsupported USB scanner it's going to act like a USB HID device; you can scan codes, and the they'll be sent as keyboard events, but there won't be any barcode scan broadcast (see BarcodeResultr in the SDK). Unless you have a text field focused Clover apps only react to the broadcast, not keyboard events.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

parag avatar image parag commented ·

I am getting barcode scanned value using dispatchKeyEvent with below source code and devices

Honeywell IHS320X (

Tvs BS-L100 (

public boolean dispatchKeyEvent(KeyEvent event) {
if ( event.getAction() == KeyEvent.ACTION_DOWN) {
if(event.getKeyCode() == KeyEvent.KEYCODE_ENTER){
return true;
} else{
return true;

But facing issue client's barcode scanner, Client is using Zebra DS2200 (

Zebra DS2200 is able to scan with Clover Register app

Also added Broadcast receiver

<action android:name="com.clover.sdk.action.CODE_SCAN" />

Also tried below clover SDK example

Please let us know if missing anything else from my end

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community