BarcodeDetector
Stay organized with collections
Save and categorize content based on your preferences.
Recognizes barcodes (in a variety of 1D and 2D formats) in a supplied Frame
.
Build new BarcodeDetector instances using BarcodeDetector.Builder
.
By default, BarcodeDetector searches for barcodes in every supported format. For the best
performance it is highly recommended that you specify a narrower set of barcode
formats to detect. For example, to create a detector that recognizes only Data Matrix and QR
codes:
BarcodeDetector detector = new BarcodeDetector.Builder(context)
.setBarcodeFormats(Barcode.DATA_MATRIX | Barcode.QR_CODE)
.build();
Recognition results are returned by
detect(Frame)
as
Barcode
instances.
Adding the vision functionality dependency to your project's
AndroidManifest.xml will indicate to the installer that it should download the dependency on
application install.
Inherited Method Summary
From class com.google.android.gms.vision.Detector
abstract SparseArray<Barcode>
|
detect(Frame arg0)
|
boolean |
isOperational()
|
void |
receiveFrame(Frame arg0)
|
void |
release()
|
boolean |
setFocus(int arg0)
|
void |
setProcessor(Processor< Barcode>
arg0)
|
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
Recognizes barcodes in the supplied Frame
.
Returns
- mapping of int to
Barcode
,
where the int domain represents an opaque ID for the barcode. Identical barcodes (as
determined by their raw value) will have the same ID across frames.
public boolean isOperational ()
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 2021-06-17 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-06-17 UTC."],[],[]]