question

Shubham Bhawsar avatar image
Shubham Bhawsar asked parag commented

Incomplete result for GS1 scanner with BarcodeScanner

Getting incomplete string in scan result, i am using GS1 barcode scanner and written below code to receive barcode action:

private final BroadcastReceiver barcodeReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        BarcodeResult barcodeResult = new BarcodeResult(intent);

        if (barcodeResult.isBarcodeAction()) {
            String barcode = barcodeResult.getBarcode();
            // check for barcode and take action
            ApiUtil.saveLogs(context, "Coupon code result "+barcode);
           
        }
    }
};

@Override
protected void onResume() {
    super.onResume();
    registerReceiver(barcodeReceiver, new IntentFilter(BarcodeResult.INTENT_ACTION));
}


I scanned these barcodes

1667716522368.png

And got these strings in barcode result

1667716546544.png

And when i scanned these with normal android phone scanner getting this result

02:34:20  ScanCouponActivity.java-->onReceive[6]-----> AppV:1.10.311 M_ID-393056 Coupon code result 51
02:33:21  ScanCouponActivity.java-->onReceive[6]-----> AppV:1.10.311 M_ID-393056 Coupon code result 52



Not getting correct code in result, Please let me know if i am missing anything to add in it

Clover Android SDKclover developer communitybarcode scanner
1667716522368.png (210.3 KiB)
1667716546544.png (31.5 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

·
mbone avatar image
mbone answered parag commented

https://www.clover.com/en-US/help/check-for-barcode-scanner-compatibility is the barcode compatibility for external scanners to Clover. I tried scanning the barcodes provided using my Flex and was unsuccessful. I would reach out to Devrel for further assistance!

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 (https://www.amazon.in/IMPACT-Honeywell-IHS320X-Barcode-Scanner/dp/B0C1VSH8GX)

Tvs BS-L100 (https://www.amazon.in/Tvs-BS-I100N-Barcode-Scanner-creators/dp/B07CNFB7N3)


@Override
public boolean dispatchKeyEvent(KeyEvent event) {
                    
super.dispatchKeyEvent(event);
if ( event.getAction() == KeyEvent.ACTION_DOWN) {
                    
if(event.getKeyCode() == KeyEvent.KEYCODE_ENTER){
                    
handleBarcodeScan(scannedBarcode.toString());
scannedBarcode.setLength(0);
return true;
} else{
                    
scannedBarcode.append(event.getDisplayLabel());
}
}
return true;
}

But facing issue client's barcode scanner, Client is using Zebra DS2200 (https://www.zebra.com/us/en/products/scanners/general-purpose-handheld-scanners/ds2200-series.html)

Zebra DS2200 is able to scan with Clover Register app


Also added Broadcast receiver

<receiver
android:name=".services.BarcodeScannerReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="com.clover.sdk.action.CODE_SCAN" />
</intent-filter>
</receiver>

Also tried below clover SDK example


https://github.com/clover/android-examples/tree/master/barcodereceiver/app/src/main/java/com/clover/example/barcodereceiver/app

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