PhoneDeviceType
public
final
class
PhoneDeviceType
extends Object
This class is deprecated.
Use androidx.wear.phone.interactions.PhoneTypeHelper
from the Jetpack Wear Phone Interactions library
instead.
Provides helper methods for determining the type of phone we are paired to.
Summary
Nested classes |
@interface |
PhoneDeviceType.DeviceType
This @interface is deprecated.
Use androidx.wear.phone.interactions.PhoneTypeHelper from the Jetpack Wear Phone Interactions library
instead.
|
Public methods |
static
int
|
getPhoneDeviceType(Context context)
Returns the type of phone handset this Wear OS device has been paired with.
|
Inherited methods |
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()
|
|
Constants
DEVICE_TYPE_ANDROID
public static final int DEVICE_TYPE_ANDROID
Indicates that we are paired to an Android phone.
Constant Value:
1
(0x00000001)
DEVICE_TYPE_ERROR_UNKNOWN
public static final int DEVICE_TYPE_ERROR_UNKNOWN
Indicates an error returned retrieving the type of phone we are paired to.
Constant Value:
0
(0x00000000)
DEVICE_TYPE_IOS
public static final int DEVICE_TYPE_IOS
Indicates that we are paired to an iOS phone.
Constant Value:
2
(0x00000002)
Public constructors
PhoneDeviceType
public PhoneDeviceType ()
Public methods
getPhoneDeviceType
public static int getPhoneDeviceType (Context context)
Returns the type of phone handset this Wear OS device has been paired with.
Parameters |
context |
Context |
Returns |
int |
one of DEVICE_TYPE_ERROR_UNKNOWN , DEVICE_TYPE_ANDROID or DEVICE_TYPE_IOS indicating we could not determine the phone type, we are paired to an
Android phone or we are paired to an iOS phone respectively.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 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 2025-02-10 UTC."],[],[],null,["# PhoneDeviceType\n\nSummary: [Nested Classes](#nestedclasses) \\| [Constants](#constants) \\| [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nPhoneDeviceType\n===============\n\n\n`\npublic\n\nfinal\n\nclass\nPhoneDeviceType\n`\n\n\n`\n\nextends `[Object](http://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------------|\n| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | android.support.wearable.phone.PhoneDeviceType |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This class is deprecated.** \n\nUse `androidx.wear.phone.interactions.PhoneTypeHelper` from the [Jetpack Wear Phone Interactions](../../../../../jetpack/androidx/releases/wear) library\ninstead.\n\nProvides helper methods for determining the type of phone we are paired to.\n\nSummary\n-------\n\n| ### Nested classes ||\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` @interface` | [PhoneDeviceType.DeviceType](../../../../../reference/android/support/wearable/phone/PhoneDeviceType.DeviceType.html) *This @interface is deprecated. Use `androidx.wear.phone.interactions.PhoneTypeHelper` from the [Jetpack Wear Phone Interactions](../../../../../jetpack/androidx/releases/wear) library instead.* |\n\n| ### Constants ||\n|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | [DEVICE_TYPE_ANDROID](../../../../../reference/android/support/wearable/phone/PhoneDeviceType.html#DEVICE_TYPE_ANDROID) Indicates that we are paired to an Android phone. |\n| `int` | [DEVICE_TYPE_ERROR_UNKNOWN](../../../../../reference/android/support/wearable/phone/PhoneDeviceType.html#DEVICE_TYPE_ERROR_UNKNOWN) Indicates an error returned retrieving the type of phone we are paired to. |\n| `int` | [DEVICE_TYPE_IOS](../../../../../reference/android/support/wearable/phone/PhoneDeviceType.html#DEVICE_TYPE_IOS) Indicates that we are paired to an iOS phone. |\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[PhoneDeviceType](../../../../../reference/android/support/wearable/phone/PhoneDeviceType.html#PhoneDeviceType())`() ` |\n\n| ### Public methods ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static int` | ` `[getPhoneDeviceType](../../../../../reference/android/support/wearable/phone/PhoneDeviceType.html#getPhoneDeviceType(android.content.Context))`(`[Context](http://developer.android.com/reference/android/content/Context.html)` context) ` Returns the type of phone handset this Wear OS device has been paired with. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html) | ` clone() ` | | ` boolean` | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void` | ` finalize() ` | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` `[String](http://developer.android.com/reference/java/lang/String.html) | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nConstants\n---------\n\n### DEVICE_TYPE_ANDROID\n\n```\npublic static final int DEVICE_TYPE_ANDROID\n```\n\nIndicates that we are paired to an Android phone.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\n### DEVICE_TYPE_ERROR_UNKNOWN\n\n```\npublic static final int DEVICE_TYPE_ERROR_UNKNOWN\n```\n\nIndicates an error returned retrieving the type of phone we are paired to.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n0\n(0x00000000)\n\n\n### DEVICE_TYPE_IOS\n\n```\npublic static final int DEVICE_TYPE_IOS\n```\n\nIndicates that we are paired to an iOS phone.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\nPublic constructors\n-------------------\n\n### PhoneDeviceType\n\n```\npublic PhoneDeviceType ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### getPhoneDeviceType\n\n```\npublic static int getPhoneDeviceType (Context context)\n```\n\nReturns the type of phone handset this Wear OS device has been paired with.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|------------------|\n| `context` | `Context` \u003cbr /\u003e |\n\n| Returns ||\n|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | one of `DEVICE_TYPE_ERROR_UNKNOWN`, `DEVICE_TYPE_ANDROID` or `DEVICE_TYPE_IOS` indicating we could not determine the phone type, we are paired to an Android phone or we are paired to an iOS phone respectively. \u003cbr /\u003e |"]]