# Barcode

public class **Barcode** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Represents a single recognized barcode and its value.

The barcode's raw, unmodified, and uninterpreted content is returned in the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getRawValue()`
field, while the barcode type (i.e. its encoding) can be found in the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getFormat()`
field.

### Nested Class Summary

|---|---|---|---|
| class | [Barcode.Address](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Address) || An address. |
| @interface | [Barcode.BarcodeFormat](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.BarcodeFormat) || Barcode format constants - enumeration of supported barcode formats: 1. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_UNKNOWN` 2. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_ALL_FORMATS` 3. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODE_128` 4. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODE_39` 5. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODE_93` 6. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODABAR` 7. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_DATA_MATRIX` 8. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_EAN_13` 9. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_EAN_8` 10. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_ITF` 11. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_QR_CODE` 12. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_UPC_A` 13. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_UPC_E` 14. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_PDF417` 15. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_AZTEC` |
| @interface | [Barcode.BarcodeValueType](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.BarcodeValueType) || Barcode value type constants - enumeration of supported barcode content value types: 1. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_UNKNOWN` 2. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_CONTACT_INFO` 3. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_EMAIL` 4. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_ISBN` 5. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_PHONE` 6. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_PRODUCT` 7. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_SMS` 8. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_TEXT` 9. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_URL` 10. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_WIFI` 11. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_GEO` 12. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_CALENDAR_EVENT` 13. `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_DRIVER_LICENSE` |
| class | [Barcode.CalendarDateTime](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.CalendarDateTime) || DateTime data type used in calendar events. |
| class | [Barcode.CalendarEvent](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.CalendarEvent) || A calendar event extracted from QRCode. |
| class | [Barcode.ContactInfo](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.ContactInfo) || A person's or organization's business card. |
| class | [Barcode.DriverLicense](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.DriverLicense) || A driver license or ID card. |
| class | [Barcode.Email](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Email) || An email message from a 'MAILTO:' or similar QRCode type. |
| class | [Barcode.GeoPoint](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.GeoPoint) || GPS coordinates from a 'GEO:' or similar QRCode type. |
| class | [Barcode.PersonName](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.PersonName) || A person's name, both formatted version and individual name components. |
| class | [Barcode.Phone](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone) || Phone number info. |
| class | [Barcode.Sms](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Sms) || A sms message from a 'SMS:' or similar QRCode type. |
| class | [Barcode.UrlBookmark](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.UrlBookmark) || A URL and title from a 'MEBKM:' or similar QRCode type. |
| class | [Barcode.WiFi](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.WiFi) || A wifi network parameters from a 'WIFI:' or similar QRCode type. |

### Constant Summary

|---|---|---|
| int | [FORMAT_ALL_FORMATS](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_ALL_FORMATS) | Barcode format constant representing the union of all supported formats. |
| int | [FORMAT_AZTEC](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_AZTEC) | Barcode format constant for AZTEC. |
| int | [FORMAT_CODABAR](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODABAR) | Barcode format constant for Codabar. |
| int | [FORMAT_CODE_128](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODE_128) | Barcode format constant for Code 128. |
| int | [FORMAT_CODE_39](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODE_39) | Barcode format constant for Code 39. |
| int | [FORMAT_CODE_93](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_CODE_93) | Barcode format constant for Code 93. |
| int | [FORMAT_DATA_MATRIX](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_DATA_MATRIX) | Barcode format constant for Data Matrix. |
| int | [FORMAT_EAN_13](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_EAN_13) | Barcode format constant for EAN-13. |
| int | [FORMAT_EAN_8](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_EAN_8) | Barcode format constant for EAN-8. |
| int | [FORMAT_ITF](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_ITF) | Barcode format constant for ITF (Interleaved Two-of-Five). |
| int | [FORMAT_PDF417](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_PDF417) | Barcode format constant for PDF-417. |
| int | [FORMAT_QR_CODE](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_QR_CODE) | Barcode format constant for QR Code. |
| int | [FORMAT_UNKNOWN](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_UNKNOWN) | Barcode format unknown to the current SDK. |
| int | [FORMAT_UPC_A](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_UPC_A) | Barcode format constant for UPC-A. |
| int | [FORMAT_UPC_E](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_UPC_E) | Barcode format constant for UPC-E. |
| int | [TYPE_CALENDAR_EVENT](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_CALENDAR_EVENT) | Barcode value type constant for calendar events. |
| int | [TYPE_CONTACT_INFO](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_CONTACT_INFO) | Barcode value type constant for contact information. |
| int | [TYPE_DRIVER_LICENSE](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_DRIVER_LICENSE) | Barcode value type constant for driver's license data. |
| int | [TYPE_EMAIL](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_EMAIL) | Barcode value type constant for email message details. |
| int | [TYPE_GEO](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_GEO) | Barcode value type constant for geographic coordinates. |
| int | [TYPE_ISBN](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_ISBN) | Barcode value type constant for ISBNs. |
| int | [TYPE_PHONE](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_PHONE) | Barcode value type constant for phone numbers. |
| int | [TYPE_PRODUCT](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_PRODUCT) | Barcode value type constant for product codes. |
| int | [TYPE_SMS](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_SMS) | Barcode value type constant for SMS details. |
| int | [TYPE_TEXT](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_TEXT) | Barcode value type constant for plain text. |
| int | [TYPE_UNKNOWN](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_UNKNOWN) | Barcode value type unknown, which indicates the current version of SDK cannot recognize the structure of the barcode. |
| int | [TYPE_URL](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_URL) | Barcode value type constant for URLs/bookmarks. |
| int | [TYPE_WIFI](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_WIFI) | Barcode value type constant for WiFi access point details. |

### Public Method Summary

|---|---|
| [Rect](https://developer.android.com/reference/android/graphics/Rect.html) | [getBoundingBox](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getBoundingBox())() Gets the bounding rectangle of the detected barcode. |
| [Barcode.CalendarEvent](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.CalendarEvent) | [getCalendarEvent](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getCalendarEvent())() Gets parsed calendar event details. |
| [Barcode.ContactInfo](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.ContactInfo) | [getContactInfo](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getContactInfo())() Gets parsed contact details. |
| [Point\[\]](https://developer.android.com/reference/android/graphics/Point.html) | [getCornerPoints](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getCornerPoints())() Returns four corner points in clockwise direction starting with top-left. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getDisplayValue](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getDisplayValue())() Returns barcode value in a user-friendly format. |
| [Barcode.DriverLicense](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.DriverLicense) | [getDriverLicense](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getDriverLicense())() Gets parsed driver license details. |
| [Barcode.Email](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Email) | [getEmail](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getEmail())() Gets parsed email details. |
| int | [getFormat](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getFormat())() Returns barcode format, for example `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_EAN_13`. |
| [Barcode.GeoPoint](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.GeoPoint) | [getGeoPoint](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getGeoPoint())() Gets parsed geo coordinates. |
| [Barcode.Phone](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone) | [getPhone](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getPhone())() Gets parsed phone number details. |
| byte\[\] | [getRawBytes](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getRawBytes())() Returns raw bytes as it was encoded in the barcode. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getRawValue](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getRawValue())() Returns barcode value as it was encoded in the barcode. |
| [Barcode.Sms](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Sms) | [getSms](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getSms())() Gets parsed SMS details. |
| [Barcode.UrlBookmark](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.UrlBookmark) | [getUrl](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getUrl())() Gets parsed URL bookmark details. |
| int | [getValueType](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType())() Returns format type of the barcode value. |
| [Barcode.WiFi](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.WiFi) | [getWifi](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getWifi())() Gets parsed WiFi AP details. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Constants

#### public static final int
**FORMAT_ALL_FORMATS**

Barcode format constant representing the union of all supported formats. This is
also the default setting.
Constant Value: 0

#### public static final int
**FORMAT_AZTEC**

Barcode format constant for AZTEC.
Constant Value: 4096

#### public static final int
**FORMAT_CODABAR**

Barcode format constant for Codabar.
Constant Value: 8

#### public static final int
**FORMAT_CODE_128**

Barcode format constant for Code 128.
Constant Value: 1

#### public static final int
**FORMAT_CODE_39**

Barcode format constant for Code 39.
Constant Value: 2

#### public static final int
**FORMAT_CODE_93**

Barcode format constant for Code 93.
Constant Value: 4

#### public static final int
**FORMAT_DATA_MATRIX**

Barcode format constant for Data Matrix.
Constant Value: 16

#### public static final int
**FORMAT_EAN_13**

Barcode format constant for EAN-13.
Constant Value: 32

#### public static final int
**FORMAT_EAN_8**

Barcode format constant for EAN-8.
Constant Value: 64

#### public static final int
**FORMAT_ITF**

Barcode format constant for ITF (Interleaved Two-of-Five).
Constant Value: 128

#### public static final int
**FORMAT_PDF417**

Barcode format constant for PDF-417.
Constant Value: 2048

#### public static final int
**FORMAT_QR_CODE**

Barcode format constant for QR Code.
Constant Value: 256

#### public static final int
**FORMAT_UNKNOWN**

Barcode format unknown to the current SDK.
Constant Value: -1

#### public static final int
**FORMAT_UPC_A**

Barcode format constant for UPC-A.
Constant Value: 512

#### public static final int
**FORMAT_UPC_E**

Barcode format constant for UPC-E.
Constant Value: 1024

#### public static final int
**TYPE_CALENDAR_EVENT**

Barcode value type constant for calendar events. Specifies the format of a Barcode
value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 11

#### public static final int
**TYPE_CONTACT_INFO**

Barcode value type constant for contact information. Specifies the format of a
Barcode value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 1

#### public static final int
**TYPE_DRIVER_LICENSE**

Barcode value type constant for driver's license data. Specifies the format of a
Barcode value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 12

#### public static final int
**TYPE_EMAIL**

Barcode value type constant for email message details. Specifies the format of a
Barcode value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 2

#### public static final int
**TYPE_GEO**

Barcode value type constant for geographic coordinates. Specifies the format of a
Barcode value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 10

#### public static final int
**TYPE_ISBN**

Barcode value type constant for ISBNs. Specifies the format of a Barcode value via
the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 3

#### public static final int
**TYPE_PHONE**

Barcode value type constant for phone numbers. Specifies the format of a Barcode
value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 4

#### public static final int
**TYPE_PRODUCT**

Barcode value type constant for product codes. Specifies the format of a Barcode
value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 5

#### public static final int
**TYPE_SMS**

Barcode value type constant for SMS details. Specifies the format of a Barcode value
via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 6

#### public static final int
**TYPE_TEXT**

Barcode value type constant for plain text. Specifies the format of a Barcode value
via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 7

#### public static final int
**TYPE_UNKNOWN**

Barcode value type unknown, which indicates the current version of SDK cannot
recognize the structure of the barcode. Developers can inspect the raw value
instead.
Constant Value: 0

#### public static final int
**TYPE_URL**

Barcode value type constant for URLs/bookmarks. Specifies the format of a Barcode
value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 8

#### public static final int
**TYPE_WIFI**

Barcode value type constant for WiFi access point details. Specifies the format of a
Barcode value via the `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` field.
Constant Value: 9

## Public Methods

#### public [Rect](https://developer.android.com/reference/android/graphics/Rect.html) **getBoundingBox** ()

Gets the bounding rectangle of the detected barcode.

Returns `null` if the bounding rectangle can not be determined.

#### public [Barcode.CalendarEvent](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.CalendarEvent)
**getCalendarEvent** ()

Gets parsed calendar event details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_CALENDAR_EVENT`.

#### public [Barcode.ContactInfo](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.ContactInfo)
**getContactInfo** ()

Gets parsed contact details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_CONTACT_INFO`.

#### public [Point\[\]](https://developer.android.com/reference/android/graphics/Point.html)
**getCornerPoints** ()

Returns four corner points in clockwise direction starting with top-left.

Due to the possible perspective distortions, this is not necessarily a
rectangle.

Returns `null` if the corner points can not be determined.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getDisplayValue** ()

Returns barcode value in a user-friendly format.

This method may omit some of the information encoded in the barcode. For example, if
`https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getRawValue()`
returns `'MEBKM:TITLE:Google;URL://www.google.com;;'`, the display value
might be `'//www.google.com'`.

This value may be multiline, for example, when line breaks are encoded into the
original TEXT barcode value. May include the supplement value.

Returns `null` if nothing found.

#### public [Barcode.DriverLicense](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.DriverLicense)
**getDriverLicense** ()

Gets parsed driver license details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_DRIVER_LICENSE`.

#### public [Barcode.Email](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Email)
**getEmail** ()

Gets parsed email details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_EMAIL`.

#### public int **getFormat** ()

Returns barcode format, for example `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#FORMAT_EAN_13`.

#### public [Barcode.GeoPoint](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.GeoPoint)
**getGeoPoint** ()

Gets parsed geo coordinates. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_GEO`.

#### public [Barcode.Phone](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone)
**getPhone** ()

Gets parsed phone number details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_PHONE`.

#### public byte\[\] **getRawBytes** ()

Returns raw bytes as it was encoded in the barcode.

Returns `null` if the raw bytes can not be determined.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getRawValue** ()

Returns barcode value as it was encoded in the barcode. Structured values are not
parsed, for example: `'MEBKM:TITLE:Google;URL://www.google.com;;'`.

It's only available when the barcode is encoded in the UTF-8 format, and for
non-UTF8 ones use `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getRawBytes()`
instead.

Returns `null` if the raw value can not be determined.

#### public [Barcode.Sms](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Sms)
**getSms** ()

Gets parsed SMS details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_SMS`.

#### public [Barcode.UrlBookmark](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.UrlBookmark)
**getUrl** ()

Gets parsed URL bookmark details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_URL`.

#### public int **getValueType** ()

Returns format type of the barcode value.

For example, `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_TEXT`,
`https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_PRODUCT`,
`https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_URL`,
etc.

If the value structure cannot be parsed, `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_TEXT`
will be returned. If the recognized structure type is not defined in your current
version of SDK, `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_UNKNOWN`
will be returned.

Note that the built-in parsers only recognize a few popular value structures. For
your specific use case, you might want to directly consume `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getRawValue()`
and implement your own parsing logic.

#### public [Barcode.WiFi](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode.WiFi)
**getWifi** ()

Gets parsed WiFi AP details. This field is set iff `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#getValueType()` is `https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#TYPE_WIFI`.