java.lang.Object | |
↳ | com.google.android.gms.vision.barcode.Barcode |
Barcode represents a single recognized barcode and its value.
The barcode's raw, unmodified, and uninterpreted content is returned in the rawValue
field, while the barcode type (i.e. its encoding) can be found in the format
field.
Barcodes that contain structured data (commonly done with QR codes) are parsed and iff valid,
the valueFormat
field is set to one of the value format constants (e.g. GEO
)
and the corresponding field is set (e.g. geoPoint
).
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Barcode.Address | An address. | ||||||||||
Barcode.CalendarDateTime | DateTime data type used in calendar events. | ||||||||||
Barcode.CalendarEvent | A calendar event extracted from QRCode. | ||||||||||
Barcode.ContactInfo | A person's or organization's business card. | ||||||||||
Barcode.DriverLicense | A driver license or ID card. | ||||||||||
Barcode.Email | An email message from a 'MAILTO:' or similar QRCode type. | ||||||||||
Barcode.GeoPoint | GPS coordinates from a 'GEO:' or similar QRCode type. | ||||||||||
Barcode.PersonName | A person's name, both formatted version and individual name components. | ||||||||||
Barcode.Phone | A phone number from a 'TEL:' or similar QRCode type. | ||||||||||
Barcode.Sms | An sms message from an 'SMS:' or similar QRCode type. | ||||||||||
Barcode.UrlBookmark | A URL and title from a 'MEBKM:' or similar QRCode type. | ||||||||||
Barcode.WiFi | A wifi network parameters from a 'WIFI:' or similar QRCode type. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ALL_FORMATS | Barcode format constant representing the union of all supported formats. | |||||||||
int | AZTEC | Barcode format constant for AZTEC. | |||||||||
int | CALENDAR_EVENT | Barcode value format constant for calendar events. | |||||||||
int | CODABAR | Barcode format constant for Codabar. | |||||||||
int | CODE_128 | Barcode format constant for Code 128. | |||||||||
int | CODE_39 | Barcode format constant for Code 39. | |||||||||
int | CODE_93 | Barcode format constant for Code 93. | |||||||||
int | CONTACT_INFO | Barcode value format constant for contact information. | |||||||||
int | DATA_MATRIX | Barcode format constant for Data Matrix. | |||||||||
int | DRIVER_LICENSE | Barcode value format constant for driver's license data. | |||||||||
int | EAN_13 | Barcode format constant for EAN-13. | |||||||||
int | EAN_8 | Barcode format constant for EAN-8. | |||||||||
int | Barcode value format constant for email message details. | ||||||||||
int | GEO | Barcode value format constant for geographic coordinates. | |||||||||
int | ISBN | Barcode value format constant for ISBNs. | |||||||||
int | ITF | Barcode format constant for ITF (Interleaved Two-of-Five). | |||||||||
int | PDF417 | Barcode format constant for PDF-417. | |||||||||
int | PHONE | Barcode value format constant for phone numbers. | |||||||||
int | PRODUCT | Barcode value format constant for product codes. | |||||||||
int | QR_CODE | Barcode format constant for QR Code. | |||||||||
int | SMS | Barcode value format constant for SMS details. | |||||||||
int | TEXT | Barcode value format constant for plain text. | |||||||||
int | UPC_A | Barcode format constant for UPC-A. | |||||||||
int | UPC_E | Barcode format constant for UPC-E. | |||||||||
int | URL | Barcode value format constant for URLs/bookmarks. | |||||||||
int | WIFI | Barcode value format constant for WiFi access point details. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
calendarEvent | Parsed calendar event details (set iff valueFormat is CALENDAR_EVENT ). |
||||||||||
contactInfo | Parsed contact details (set iff valueFormat is CONTACT_INFO ). |
||||||||||
cornerPoints | 4 corner points in clockwise direction starting with top-left. | ||||||||||
displayValue | Barcode value in a user-friendly format. | ||||||||||
driverLicense | Parsed driver's license details (set iff valueFormat is DRIVER_LICENSE ). |
||||||||||
Parsed email details (set iff valueFormat is EMAIL ). |
|||||||||||
format | Barcode format, for example EAN_13 . |
||||||||||
geoPoint | Parsed geo coordinates (set iff valueFormat is GEO ). |
||||||||||
phone | Parsed phone details (set iff valueFormat is PHONE ). |
||||||||||
rawValue | Barcode value as it was encoded in the barcode. | ||||||||||
sms | Parsed SMS details (set iff valueFormat is SMS ). |
||||||||||
url | Parsed URL bookmark details (set iff valueFormat is URL ). |
||||||||||
valueFormat | Format of the barcode value. | ||||||||||
wifi | Parsed WiFi AP details (set iff valueFormat is WIFI ). |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the barcode's axis-aligned bounding box.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Barcode format constant representing the union of all supported formats. Pass into setBarcodeFormats(int)
to select formats to recognize. This is also the
default setting.
Barcode format constant for AZTEC. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a detected Barcode's format via the format
field.
Barcode value format constant for calendar events. Specifies the format of a Barcode value via
the valueFormat
field.
Barcode format constant for Codabar. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode format constant for Code 128. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode format constant for Code 39. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode format constant for Code 93. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode value format constant for contact information. Specifies the format of a Barcode value
via the valueFormat
field.
Barcode format constant for Data Matrix. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode value format constant for driver's license data. Specifies the format of a Barcode
value via the valueFormat
field.
Barcode format constant for EAN-13. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a detected Barcode's format via the format
field.
Barcode format constant for EAN-8. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a detected Barcode's format via the format
field.
Barcode value format constant for email message details. Specifies the format of a Barcode
value via the valueFormat
field.
Barcode value format constant for geographic coordinates. Specifies the format of a Barcode
value via the valueFormat
field.
Barcode value format constant for ISBNs. Specifies the format of a Barcode value via the valueFormat
field.
Barcode format constant for ITF (Interleaved Two-of-Five). Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode format constant for PDF-417. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode value format constant for phone numbers. Specifies the format of a Barcode value via
the valueFormat
field.
Barcode value format constant for product codes. Specifies the format of a Barcode value via
the valueFormat
field.
Barcode format constant for QR Code. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a
detected Barcode's format via the format
field.
Barcode value format constant for SMS details. Specifies the format of a Barcode value via the
valueFormat
field.
Barcode value format constant for plain text. Specifies the format of a Barcode value via the
valueFormat
field.
Barcode format constant for UPC-A. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a detected Barcode's format via the format
field.
Barcode format constant for UPC-E. Pass into setBarcodeFormats(int)
to select formats to recognize, and also specifies a detected Barcode's format via the format
field.
Barcode value format constant for URLs/bookmarks. Specifies the format of a Barcode value via
the valueFormat
field.
Barcode value format constant for WiFi access point details. Specifies the format of a Barcode
value via the valueFormat
field.
Parsed calendar event details (set iff valueFormat
is CALENDAR_EVENT
).
Parsed contact details (set iff valueFormat
is CONTACT_INFO
).
4 corner points in clockwise direction starting with top-left. Due to the possible perspective distortions, this is not necessarily a rectangle.
Barcode value in a user-friendly format. May omit some of the information encoded in the barcode. For example, in the case above the display_value might be 'https://www.google.com'. If valueFormat==TEXT, this field will be equal to rawValue. This value may be multiline, for example, when line breaks are encoded into the original TEXT barcode value. May include the supplement value.
Parsed driver's license details (set iff valueFormat
is DRIVER_LICENSE
).
Barcode format, for example EAN_13
.
Note that this field may contain values not present in the current set of format constants. When mapping this value to something else, it is advisable to have a default/fallback case.
Barcode value as it was encoded in the barcode. Structured values are not parsed, for example: 'MEBKM:TITLE:Google;URL:https://www.google.com;;' Does not include the supplement value.
Returns the barcode's axis-aligned bounding box.
Returns | |
---|---|
Rect |