Barcode detector builder.
Public Constructor Summary
Public Method Summary
BarcodeDetector |
build()
Builds a barcode detector instance using the provided settings.
|
BarcodeDetector.Builder |
setBarcodeFormats(int format)
Bit mask (containing values like
Barcode.QR_CODE and so on) that selects which formats this barcode
detector should recognize.
|
Inherited Method Summary
Public Constructors
public Builder (Context context)
Builder for BarcodeDetector.
Public Methods
public BarcodeDetector build ()
Builds a barcode detector instance using the provided settings. If the underlying
native implementation is unavailable (e.g. hasn't been downloaded yet), the detector
will always return an empty result set. In this case, it will report that it is
non-operational via
BarcodeDetector.isOperational()
.
Note that this method may cause blocking disk reads and should not be called on an
application's main thread. To avoid blocking the main thread, consider moving Detector
construction to a background thread using AsyncTask
.
Enable StrictMode
to
automatically detect blocking operations on the main thread.
Returns
- new
BarcodeDetector
instance
public BarcodeDetector.Builder setBarcodeFormats (int format)
Bit mask (containing values like Barcode.QR_CODE
and so on) that selects which formats this barcode detector should recognize.
The full list of supported format constants is:
Barcode.ALL_FORMATS
Barcode.AZTEC
Barcode.CODE_128
Barcode.CODE_39
Barcode.CODE_93
Barcode.CODABAR
Barcode.DATA_MATRIX
Barcode.EAN_13
Barcode.EAN_8
Barcode.ITF
Barcode.PDF417
Barcode.QR_CODE
Barcode.UPC_A
Barcode.UPC_E
Barcode.ALL_FORMATS
constant.