Barcode Settings
In order to use the internal camera as a barcode scanner, you need to specify the settings for it.
A barcode settings file could look like this:
<?xml version="1.0" encoding="UTF-8"?> <settings> <decoder>scandit</decoder> <mode>single</mode> <timeout unit="MILLISECONDS">-1</timeout> <caching unit="MILLISECONDS">-1</caching> <roi>0.0,0.0,1.0,1.0</roi> <symbologies> <symbology min="0" max="0">qr</symbology> </symbologies> <hints> <force active="false"/> </hints> <source>CAMERA</source> </settings>
Properties
The properties for Barcode settings are:
<decoder>: Defines the decoding engine to be used (scandit
or honeywell
).
<mode>: Defines if decoding should stop after one successful scan (single
) or not (continuous
).
<timeout>: Defines the time after which decoding will stop. To have no timeout at all, set it to -1
.
<caching>: Defines the decoder cache settings to retain scanned codes for a certain amount of time. This will prevent the decoder from scanning the same code over and over again. To disable caching entirely, set it to -1
.
<symbologies>: Defines the code types that the scanner will pick up (ean 8
, ean13
, upca
, upce
, code39
, code93
, code128
, msi
, qr
, datamatrix
, or pdf47
). The min
and max
attributes define the minimum and maximum length of the recognized codes.
<blackwhitelist>: Defines which codes are accepted, other types will be treated as incorrect. You can use <symbology> tags (as described above) as well as <pattern> tags. When using <pattern> tags, make sure to mark the start of a particular pattern with ^
and the end with $
and include the actual code structure in between these markers.
Full sample
<?xml version="1.0" encoding="UTF-8"?> <settings> <decoder>scandit</decoder> <mode>single</mode> <timeout unit="MILLISECONDS">10000</timeout> <caching unit="MILLISECONDS">-1</caching> <!-- Caching disabled --> <roi>0.2,0.2,0.8,0.8</roi> <symbologies> <symbology min="1" max="100">qr</symbology> <!-- It is possible to activate more than one symbology, but due to perfomance reasons it is recommended to keep the number of activated symbologies as small as possible. <symbology min="8" max="8">ean 8</symbology> <symbology min="8" max="13">ean 13</symbology> <symbology min="12" max="12">upca</symbology> <symbology min="6" max="6">upce</symbology> <symbology min="3" max="40">code 39</symbology> <symbology min="5" max="40">code 93</symbology> <symbology min="1" max="50">code 128</symbology> <symbology min="3" max="32">msi</symbology> <symbology min="1" max="100">datamatrix</symbology> <symbology min="3" max="30">pdf47</symbology>--> </symbologies> <hints> <force active="false"/> </hints> <source>CAMERA</source> <blackwhitelist whitelist="true"> <code> <symbology>qr</symbology> <pattern>^1$</pattern> </code> </blackwhitelist> </settings>
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article