BarcodeScannerConfig
BarcodeScannerConfig
is the class that defines the configurations for barcode scanning. Once the BarcodeScannerConfig
object is made, it is set via the BarcodeScannerActivity.ResultContract
.
Definition
Assembly: DynamsoftBarcodeReaderBundle.aar
Namespace: com.dynamsoft.dbrbundle.ui
final class BarcodeScannerConfig
Methods
Method | Description |
---|---|
setLicense |
Sets the license key for the Barcode Reader. |
setTemplateFilePath |
Sets the parameters template for the Barcode Reader via a local JSON file path. |
setBarcodeFormats |
Sets the barcode format(s) to read. |
setScanRegion |
Sets a scan region where only the barcodes located in the scan region can be decoded. |
setTorchButtonVisible |
Sets whether to display the torch button when scanning or not. |
setBeepEnabled |
Sets whether to trigger a beep sound when a barcode is detected. |
setScanLaserVisible |
Sets whether to display a scan laser when scanning. |
setAutoZoomEnabled |
Sets whether to enable the auto-zoom feature when scanning. |
setCloseButtonVisible |
Sets whether to display a button that can close the scanner page. |
getLicense |
Returns the license key string. |
getTemplateFilePath |
Returns the file path of the template file if one is being used. |
isTorchButtonVisible |
Returns whether the button is visible. |
getBarcodeFormats |
Returns the barcode format(s) that the library will accept. |
getScanRegion |
Returns the scan region. |
isBeepEnabled |
Returns whether the beep sound is enabled. |
isScanLaserVisible |
Returns whether the scan laser is visible. |
isAutoZoomEnabled |
Returns whether the auto-zoom feature is enabled. |
isCloseButtonVisible |
Returns whether the close button is visible. |
setLicense
Sets the license key for the Barcode Reader.
void setLicense(String license);
Parameter(s)
license
: The license key to be used for initialization.
setTemplateFilePath
Sets the local JSON file path that will configure the parameters template for the Barcode Reader.
void setTemplateFilePath(String templateFilePath);
Parameter(s)
templateFilePath
: The path of the JSON template file.
setBarcodeFormats
Sets the barcode format(s) to read.
void setBarcodeFormats(long format);
Parameter(s)
format
: A combined value of EnumBarcodeFormat
to specify which barcode format(s) the library should target.
setScanRegion
Sets a scan region. Only the barcodes located in the scan region can be decoded.
void setScanRegion(DSRect scanRegion);
Parameter(s)
scanRegion
: A DSRect
object that specifies the scan region.
setTorchButtonVisible
Sets whether to display the torch button when scanning. User can click the torch button to turn on/off the torch.
void setTorchButtonVisible(boolean torchButtonVisible);
Parameter(s)
torchButtonVisible
: A boolean value that determines whether to display the torch button.
setBeepEnabled
Sets whether to trigger a beep sound when a barcode is detected.
void setBeepEnabled(boolean beepEnabled);
Parameter(s)
beepEnabled
: A boolean value that determines whether to enable the beep sound.
setScanLaserVisible
Sets whether to display a scan laser when scanning.
void setScanLaserVisible(boolean scanLaserVisible);
Parameter(s)
scanLaserVisible
: A boolean value that determines whether to display the scan laser.
setAutoZoomEnabled
Sets whether to enable the auto-zoom feature when scanning.
void setAutoZoomEnabled(boolean autoZoomEnabled);
Parameter(s)
autoZoomEnabled
: A boolean value that determines whether to enable the auto-zoom feature.
setCloseButtonVisible
Sets whether to display a button that can close the scanner page.
void setCloseButtonVisible(boolean closeButtonVisible);
Parameter(s)
closeButtonVisible
: A boolean value that determines whether to display the close button.
getLicense
Returns the license key string.
String getLicense();
Return Value
The license key to be used for initialization.
getTemplateFilePath
Get the file path of the template file.
String getTemplateFilePath();
Return Value
The path of the JSON template file.
getBarcodeFormats
Returns the barcode format settings.
long getBarcodeFormats();
Return Value
A combined value of EnumBarcodeFormat
to specify which barcode format(s) the library should target.
getScanRegion
Returns the scan region.
DSRect getScanRegion();
Return Value
A DSRect
object that specifies the scan region.
isTorchButtonVisible
Returns a boolean indicating whether or not the torch button is visible.
boolean isTorchButtonVisible();
Return Value
A boolean value that determines whether the torch button is displayed.
isBeepEnabled
Returns a boolean indicating whether or not the beep sound is enabled.
boolean isBeepEnabled();
Return Value
A boolean value that determines whether the beep sound is enabled.
isScanLaserVisible
Returns a boolean indicating whether or not the scan laser is visible.
boolean isScanLaserVisible();
Return Value
A boolean value that determines whether the scan laser is displayed.
isAutoZoomEnabled
Returns a boolean indicating whether or not the auto-zoom feature is enabled.
boolean isAutoZoomEnabled();
Return Value
A boolean value that determines whether the auto-zoom feature is enabled.
isCloseButtonVisible
Returns a boolean indicating whether or not the close button is visible.
boolean isCloseButtonVisible();
Return Value
A boolean value that determines whether the close button is displayed.