Skip to content

Most visited

Recently visited

navigation

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 Android Wear 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 Android Wear 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.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)