GmsBarcodeScannerOptions.Builder

  • GmsBarcodeScannerOptions.Builder is used to build GmsBarcodeScannerOptions instances.

  • The builder provides methods to allow manual barcode input, enable auto-zoom, and set specific barcode formats.

  • Using setBarcodeFormats can improve the barcode scanner's speed by limiting supported formats.

  • The build method finalizes the options configuration.

public static class GmsBarcodeScannerOptions.Builder extends Object

Builder to build out a GmsBarcodeScannerOptions .

Public Constructor Summary

Public Method Summary

GmsBarcodeScannerOptions.Builder
allowManualInput ()
Allows users to input barcode manually.
GmsBarcodeScannerOptions.Builder
enableAutoZoom ()
Allows auto-zoom feature, disabled by default.
GmsBarcodeScannerOptions.Builder
setBarcodeFormats (int format, int... moreFormats)
Sets the interested barcode formats defined in Barcode.BarcodeFormat .

Inherited Method Summary

From class java.lang.Object
Object
clone()
boolean
equals(Object arg0)
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 Constructors

public Builder ()

Builder for GmsBarcodeScannerOptions .

Public Methods

public GmsBarcodeScannerOptions.Builder allowManualInput ()

Allows users to input barcode manually. Disallowed by default.

public GmsBarcodeScannerOptions build ()

Builds a GmsBarcodeScannerOptions instance.

public GmsBarcodeScannerOptions.Builder enableAutoZoom ()

Allows auto-zoom feature, disabled by default.

public GmsBarcodeScannerOptions.Builder setBarcodeFormats (int format, int... moreFormats)

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.