GmsBarcodeScannerOptions.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
Allows users to input barcode manually. Disallowed by default.
Allows auto-zoom feature, disabled by default.
Sets the interested barcode formats defined in Barcode.BarcodeFormat
.
e.g. setBarcodeFormats(Barcode.FORMAT_QR_CODE,
Barcode.FORMAT_UPC_A)
.
Reducing the number of supported formats will make the barcode scanner faster.
Default: all formats are supported.
Parameters
format |
supported barcode format |
moreFormats |
more supported barcode formats |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eGmsBarcodeScannerOptions.Builder\u003c/code\u003e helps configure barcode scanning behavior before starting the scanner.\u003c/p\u003e\n"],["\u003cp\u003eAllows customization of features like manual barcode input and auto-zoom.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can specify desired barcode formats to improve scanning speed.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e method creates a \u003ccode\u003eGmsBarcodeScannerOptions\u003c/code\u003e instance with the selected configurations.\u003c/p\u003e\n"]]],["The `GmsBarcodeScannerOptions.Builder` class facilitates creating `GmsBarcodeScannerOptions` instances. Key actions include: initializing a `Builder` object, setting barcode formats with `setBarcodeFormats`, enabling manual barcode input via `allowManualInput`, and activating auto-zoom using `enableAutoZoom`. The `build` method generates a `GmsBarcodeScannerOptions` object based on these configurations. By default, all barcode formats are supported, but you can speed up scanning by specifying formats.\n"],null,["# GmsBarcodeScannerOptions.Builder\n\npublic static class **GmsBarcodeScannerOptions.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nBuilder to build out a [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions). \n\n### Public Constructor Summary\n\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder#Builder())() Builder for [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions). |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GmsBarcodeScannerOptions.Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder) | [allowManualInput](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder#allowManualInput())() Allows users to input barcode manually. |\n| [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions) | [build](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder#build())() Builds a [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions) instance. |\n| [GmsBarcodeScannerOptions.Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder) | [enableAutoZoom](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder#enableAutoZoom())() Allows auto-zoom feature, disabled by default. |\n| [GmsBarcodeScannerOptions.Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder) | [setBarcodeFormats](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder#setBarcodeFormats(int,%20int...))(int format, int... moreFormats) Sets the interested barcode formats defined in [Barcode.BarcodeFormat](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.BarcodeFormat). |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public **Builder** ()\n\nBuilder for [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions).\n\nPublic Methods\n--------------\n\n#### public [GmsBarcodeScannerOptions.Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder) **allowManualInput** ()\n\nAllows users to input barcode manually. Disallowed by default. \n\n#### public [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions)\n**build** ()\n\nBuilds a [GmsBarcodeScannerOptions](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions)\ninstance. \n\n#### public [GmsBarcodeScannerOptions.Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder) **enableAutoZoom** ()\n\nAllows auto-zoom feature, disabled by default. \n\n#### public [GmsBarcodeScannerOptions.Builder](/android/reference/com/google/mlkit/vision/codescanner/GmsBarcodeScannerOptions.Builder) **setBarcodeFormats** (int format, int... moreFormats)\n\nSets the interested barcode formats defined in [Barcode.BarcodeFormat](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.BarcodeFormat).\n\ne.g. `setBarcodeFormats(Barcode.FORMAT_QR_CODE,\nBarcode.FORMAT_UPC_A)`.\n\nReducing the number of supported formats will make the barcode scanner faster.\n\nDefault: all formats are supported. \n\n##### Parameters\n\n| format | supported barcode format |\n| moreFormats | more supported barcode formats |\n|-------------|--------------------------------|"]]