Barcode scanner - dotcode

  1. SDK Version: 35
  2. Issues with Android

I’m using expo to scan DataMatrix barcodes within my app. Most barcodes work, however, there’s a slightly different version that uses dots, rather than squares. iPhone picks up the barcode but android is having trouble. I tested with an alternative, third-party app to scan the barcode and it works. So it looks like an expo specific problem. I really wanted to avoid ejecting expo…

If you have an android phone, can you test these barcodes for me (left not working in android and right is)? Feedback and suggestions welcome!

I think the problem is the white on black. Try this one:

Yes, that works. Thank you for taking the time.

Unfortunately, our client is using inverted barcodes. The only option, for now, is to use RNcamera which allows this mode.

hmmm… It’s a pity the ImageManipulator module doesn’t allow you to invert the colours on an image.

Hey @dcactiv,

Sorry the Expo module fell short for you here. I would suggest creating a feature request on our Canny Board so we can track and gauge interest in getting inverted barcode support added.


After further investigation, it’s quite complex and required google’s firebase MLKIT integrated with RNcamera in order to handle inverted barcodes.

I’ll add it to the canny board anyway. Maybe there’s another way to handle it.

Conceptually it seems not too difficult, as long as you can find the libraries to do the following, but maybe I’m missing something:

  • Threshold the image to get a black and white image.
  • Count black vs. white pixels in this black and white image.
  • If there are more black than white pixels, invert the image. (Maybe the original or maybe the binarised version. See what works best.)
  • Scan as normal.
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.