Capturing a barcode using the device's camera
You can also add the required="true" attribute if neccessary.
Using regex="" with barcodes
Due to the type of data encoded within a barcode (text), the regex="" attribute can also be used within the <barcode> tag allowing you to specify a pattern that the encoded data must adhere to. This could prevent the wrong kind of barcode being scanned by mistake.
For example, you may have setup a project scanning the barcodes of books which encode their ISBN number. You could specify a regex pattern which checks that the barcode scanned contains a valid ISBN (eg see here)
Alternatively you may have a project where different samples are taken from patients within a hospital (blood or urine) and you wish to label different types of sample tubes with different kinds of barcode, to add laboratory results to your database post-processing. Your pre-printed blood barcodes may encode a set of integers preceded by the letter 'B' and your urine barcodes may contain a set of integers preceded by the letter 'U'. To avoid a user scanning a blood barcode when they should be recording a urine barcdode, you could specify a regex within the urine barcode input which checks, when scanning, that the data encoded in the barcode starts with 'U' and warn the user if it does not.
Within EpiCollect+ we utilise the open source barcode scanning library ZXing (See here) and wish to pay thanks to their development work.
ZXing must be installed on a mobile device for EpiCollect+ to undertake barcode scans.
Should a user try to scan without ZXing installed, and provided they are connected to a data network (2/3/4G or wireless), ZXIng will be automatically downloaded and installed from within EpiCollect+
Alternatively, a user can install ZXIng directly onto a device from the Android market or by clicking here.