Android EMDK Stripping Leading 0 on EAN13 Barcodes


My team is working with UPC-A and EAN-13 barcodes and would like to retain the leading 0 as part of the EAN-13 barcodes. We are using the EMDK for Android and currently are enabling the decoderParams for both UPC-A and EAN-13 as shown below.

decoderParams.upca.enabled = true
decoderParams.ean13.enabled = true

With this configuration, scanning an EAN-13 barcode with a leading zero (ex: 0745114240422) will return the barcode without the zero (745114240422). We have searched for a way to stop this from happening but cannot find a solution. One possible solution we found was to enable the COUNTRY and SYS_CHAR as part of the Preamble for the UPC-A barcodes, so our configuration then looks like this:

decoderParams.upca.preamble = ScannerConfig.Preamble.COUNTRY_AND_SYS_CHAR
decoderParams.upca.enabled = true
decoderParams.ean13.enabled = true

This configuration does prevent the leading zero from being stripped off of the EAN-13 barcodes, however, it adds a leading zero to the UPC-A barcodes (Ex: 745114240422 becomes 0745114240422), which is not something that we would like.

Is this our only option for resolution or is there an additional parameter or solution that we are overlooking?

Thank you!

Submitted by James Swinton … on January 17, 2022 Permalink

Hi Lindsey,

Unfortunately I believe this is indeed your only option. You could potentially add an ADF rule to datawedge which says "If barcode symbology is UPC-A, strip the leading zero" which would achieve your desired outcome. Alternatively you could handle this with logic in your app, too.

Please see here for ADF documentation: