# ArDevice

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

*** ** * ** ***


```
public final class ArDevice implements Trackable
```

<br />

*** ** * ** ***

Contains the information of the device that locates it with respect to the real world.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/xr/arcore/ArDevice.State implements https://developer.android.com/reference/androidx/xr/arcore/Trackable.State` Contains the current state of the AR Device tracking. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/arcore/ArDevice#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/ArDevice` | `https://developer.android.com/reference/androidx/xr/arcore/ArDevice#getInstance(androidx.xr.runtime.Session)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session)` Returns the AR device tracking data. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/ArDevice.State>` | `https://developer.android.com/reference/androidx/xr/arcore/ArDevice#getState()()` the current `https://developer.android.com/reference/androidx/xr/arcore/ArDevice.State` of the AR device tracking |
| `int` | `https://developer.android.com/reference/androidx/xr/arcore/ArDevice#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/arcore/ArDevice#toString()()` Returns a string representation of `https://developer.android.com/reference/androidx/xr/arcore/ArDevice` for debugging. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getInstance

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

```
public static final @NonNull ArDevice getInstance(@NonNull Session session)
```

Returns the AR device tracking data.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session` | the currently active `https://developer.android.com/reference/androidx/xr/runtime/Session` |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if `https://developer.android.com/reference/androidx/xr/runtime/Session#config()` is set to `https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode#DISABLED()` |

### getState

```
public @NonNull StateFlow<@NonNull ArDevice.State> getState()
```

the current `https://developer.android.com/reference/androidx/xr/arcore/ArDevice.State` of the AR device tracking

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```

Returns a string representation of `https://developer.android.com/reference/androidx/xr/arcore/ArDevice` for debugging.

Note: Not intended for production use.