PhoneDeviceType

public final class PhoneDeviceType
extends Object

java.lang.Object
   ↳ android.support.wearable.phone.PhoneDeviceType


Provides helper methods for determining the type of phone we are paired to.

Summary

Nested classes

@interface PhoneDeviceType.DeviceType

Annotates a value of DeviceType. 

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

From class java.lang.Object

Constants

DEVICE_TYPE_ANDROID

int DEVICE_TYPE_ANDROID

Indicates that we are paired to an Android phone.

Constant Value: 1 (0x00000001)

DEVICE_TYPE_ERROR_UNKNOWN

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

int DEVICE_TYPE_IOS

Indicates that we are paired to an iOS phone.

Constant Value: 2 (0x00000002)

Public constructors

PhoneDeviceType

PhoneDeviceType ()

Public methods

getPhoneDeviceType

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.