# PhoneTypeHelper

Artifact: [androidx.wear:wear-phone-interactions](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/phone/interactions/PhoneTypeHelper.kt+class:androidx.wear.phone.interactions.PhoneTypeHelper) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

*** ** * ** ***


```
class PhoneTypeHelper
```

<br />

*** ** * ** ***

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

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/phone/interactions/PhoneTypeHelper#DEVICE_TYPE_ANDROID() = 1` Indicates that we are paired to an Android phone. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/phone/interactions/PhoneTypeHelper#DEVICE_TYPE_ERROR() = 0` Indicates an error returned retrieving the type of phone we are paired to. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/phone/interactions/PhoneTypeHelper#DEVICE_TYPE_IOS() = 2` Indicates that we are paired to an iOS phone. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/phone/interactions/PhoneTypeHelper#DEVICE_TYPE_NONE() = 4` Indicates that device is not paired to phone. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/phone/interactions/PhoneTypeHelper#DEVICE_TYPE_UNKNOWN() = 3` Indicates unknown type of phone we are paired to. |

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/phone/interactions/PhoneTypeHelper#getPhoneDeviceType(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Returns the type of phone handset this Wear OS device has been paired with. |

## Constants

### DEVICE_TYPE_ANDROID

```
const val DEVICE_TYPE_ANDROID = 1: Int
```

Indicates that we are paired to an Android phone.

### DEVICE_TYPE_ERROR

```
const val DEVICE_TYPE_ERROR = 0: Int
```

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

### DEVICE_TYPE_IOS

```
const val DEVICE_TYPE_IOS = 2: Int
```

Indicates that we are paired to an iOS phone.

### DEVICE_TYPE_NONE

```
const val DEVICE_TYPE_NONE = 4: Int
```

Indicates that device is not paired to phone.

### DEVICE_TYPE_UNKNOWN

```
const val DEVICE_TYPE_UNKNOWN = 3: Int
```

Indicates unknown type of phone we are paired to.

## Public companion functions

### getPhoneDeviceType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

```
fun getPhoneDeviceType(context: Context): Int
```

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

Value is one of the following:

- `0`
- `1`
- `2`
- `3`
- `4`

<br />

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | one of `DEVICE_TYPE_ERROR`, `DEVICE_TYPE_ANDROID`, `DEVICE_TYPE_IOS`, `DEVICE_TYPE_UNKNOWN` or `DEVICE_TYPE_NONE` indicating we had an error while determining the phone type, we are paired to an Android phone, we are paired to an iOS phone, we could not determine the phone type respectively, or no phone is paired respectively. |