Barcode.Phone
Stay organized with collections
Save and categorize content based on your preferences.
Nested Class Summary
@interface
Phone number format type constants.
Inherited Method Summary
From class java.lang.Object
Constants
public static final int
TYPE_FAX
public static final int
TYPE_HOME
public static final int
TYPE_MOBILE
public static final int
TYPE_UNKNOWN
public static final int
TYPE_WORK
Public Methods
public String
getNumber
()
Gets phone number.
Returns null
if not available.
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.
[[["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 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eBarcode.Phone\u003c/code\u003e provides structured information about phone numbers detected within barcodes.\u003c/p\u003e\n"],["\u003cp\u003eIt includes the phone number itself (\u003ccode\u003egetNumber()\u003c/code\u003e) and its type (e.g., home, work, mobile using \u003ccode\u003egetType()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eFive constants represent common phone types: \u003ccode\u003eTYPE_FAX\u003c/code\u003e, \u003ccode\u003eTYPE_HOME\u003c/code\u003e, \u003ccode\u003eTYPE_MOBILE\u003c/code\u003e, \u003ccode\u003eTYPE_UNKNOWN\u003c/code\u003e, and \u003ccode\u003eTYPE_WORK\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA nested class, \u003ccode\u003eBarcode.Phone.FormatType\u003c/code\u003e, likely offers additional details about the phone number's format.\u003c/p\u003e\n"],["\u003cp\u003eThis class is part of a larger barcode scanning API, indicated by its parent class, \u003ccode\u003eBarcode\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `Barcode.Phone` class provides information about a phone number. It defines constants for phone types: `TYPE_FAX`, `TYPE_HOME`, `TYPE_MOBILE`, `TYPE_UNKNOWN`, and `TYPE_WORK`. The class offers two primary methods: `getNumber()`, which retrieves the phone number as a string, and `getType()`, which returns the phone number's type. Additionally it contains methods that are inherited from the `java.lang.Object` class, such as `clone()`, `equals()`, `hashCode()` etc.\n"],null,["# Barcode.Phone\n\npublic static class **Barcode.Phone** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nPhone number info. \n\n### Nested Class Summary\n\n|------------|---|---|-------------------------------------|\n| @interface | [Barcode.Phone.FormatType](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone.FormatType) || Phone number format type constants. |\n\n### Constant Summary\n\n|-----|------------------------------------------------------------------------------------------------------|---------------------|\n| int | [TYPE_FAX](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#TYPE_FAX) | Fax machine. |\n| int | [TYPE_HOME](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#TYPE_HOME) | Home phone. |\n| int | [TYPE_MOBILE](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#TYPE_MOBILE) | Mobile phone. |\n| int | [TYPE_UNKNOWN](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#TYPE_UNKNOWN) | Unknown phone type. |\n| int | [TYPE_WORK](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#TYPE_WORK) | Work phone. |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [String](//developer.android.com/reference/java/lang/String.html) | [getNumber](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#getNumber())() Gets phone number. |\n| int | [getType](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone#getType())() Gets type of the phone number. |\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\nConstants\n---------\n\n#### public static final int\n**TYPE_FAX**\n\nFax machine. \nConstant Value: 3 \n\n#### public static final int\n**TYPE_HOME**\n\nHome phone. \nConstant Value: 2 \n\n#### public static final int\n**TYPE_MOBILE**\n\nMobile phone. \nConstant Value: 4 \n\n#### public static final int\n**TYPE_UNKNOWN**\n\nUnknown phone type. \nConstant Value: 0 \n\n#### public static final int\n**TYPE_WORK**\n\nWork phone. \nConstant Value: 1\n\nPublic Methods\n--------------\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getNumber** ()\n\nGets phone number.\n\nReturns `null` if not available. \n\n#### public int **getType** ()\n\nGets type of the phone number.\n\nSee also [Barcode.Phone.FormatType](/android/reference/com/google/mlkit/vision/barcode/common/Barcode.Phone.FormatType)."]]