Android 12 Developer Preview is here! Try it out, and give us your feedback!

PhoneTypeHelper

class PhoneTypeHelper
kotlin.Any
   ↳ androidx.wear.phone.interactions.PhoneTypeHelper

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

Summary

Constants
const Int

Indicates that we are paired to an Android phone.

const Int

Indicates an error returned retrieving the type of phone we are paired to.

const Int

Indicates that we are paired to an iOS phone.

const Int

Indicates unknown type of phone we are paired to.

Companion functions
Int

Returns the type of phone handset this Wear OS device has been paired with.

Constants

DEVICE_TYPE_ANDROID

const val DEVICE_TYPE_ANDROID: Int

Indicates that we are paired to an Android phone.

Value: 1

DEVICE_TYPE_ERROR

const val DEVICE_TYPE_ERROR: Int

Indicates an error returned retrieving the type of phone we are paired to.

Value: 0

DEVICE_TYPE_IOS

const val DEVICE_TYPE_IOS: Int

Indicates that we are paired to an iOS phone.

Value: 2

DEVICE_TYPE_UNKNOWN

const val DEVICE_TYPE_UNKNOWN: Int

Indicates unknown type of phone we are paired to.

Value: 3

Companion functions

getPhoneDeviceType

@JvmStatic fun getPhoneDeviceType(context: Context): Int

Returns the type of phone handset this Wear OS device has been paired with.

Return
one of DEVICE_TYPE_ERROR, DEVICE_TYPE_ANDROID, DEVICE_TYPE_IOS or DEVICE_TYPE_UNKNOWN indicating we had an error while determining the phone type, we are paired to an Android phone, we are paired to an iOS phone or we could not determine the phone type respectively.