PhoneDeviceType
public
final
class
PhoneDeviceType
extends Object
java.lang.Object | |
↳ | android.support.wearable.phone.PhoneDeviceType |
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 |
Constants | |
---|---|
int |
DEVICE_TYPE_ANDROID
Indicates that we are paired to an Android phone. |
int |
DEVICE_TYPE_ERROR_UNKNOWN
Indicates an error returned retrieving the type of phone we are paired to. |
int |
DEVICE_TYPE_IOS
Indicates that we are paired to an iOS phone. |
Public constructors | |
---|---|
PhoneDeviceType()
|
Public methods | |
---|---|
static
int
|
getPhoneDeviceType(Context context)
Returns the type of phone handset this Wear OS device has been paired with. |
Inherited methods | |
---|---|
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 2024-04-11 UTC.