# DeviceTrackingMode

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

*** ** * ** ***


```
public final class DeviceTrackingMode
```

<br />

*** ** * ** ***

Feature that allows tracking of the AR device.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode` | `https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode#DISABLED()` The device pose will not be tracked. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode` | `@https://developer.android.com/reference/androidx/xr/runtime/ExperimentalInertialTrackingApi https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode#INERTIAL()` Tracks device pose with 3DoF (rotation only) and provides the last known pose from the system. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode` | `https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode#SPATIAL()` Tracks device pose and provides the last known 6DoF (rotation and translation) pose from the system. |

| ### Public methods |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode#getMode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode#toString()()` Returns a string representation of `https://developer.android.com/reference/androidx/xr/runtime/DeviceTrackingMode` for debugging. |

## Public fields

### DISABLED

```
public static final @NonNull DeviceTrackingMode DISABLED
```

The device pose will not be tracked. In this mode, `https://developer.android.com/reference/androidx/xr/arcore/RenderViewpoint` will not emit updates to `https://developer.android.com/reference/androidx/xr/arcore/RenderViewpoint.State#pose()`.

### INERTIAL

```
@ExperimentalInertialTrackingApi
public static final @NonNull DeviceTrackingMode INERTIAL
```

Tracks device pose with 3DoF (rotation only) and provides the last known pose from the system. Note that there is generally a delay between the actual device pose and the pose provided by the system by the time of the update.

Supported runtimes:

- Projected

### SPATIAL

```
public static final @NonNull DeviceTrackingMode SPATIAL
```

Tracks device pose and provides the last known 6DoF (rotation and translation) pose from the system. Note that there is generally a delay between the actual device pose and the pose provided by the system by the time of the update.

Supported runtimes:

- OpenXR

- Play Services

Required permissions:

- `https://developer.android.com/reference/android/Manifest.permission.html#CAMERA` (Play Services runtimes only)

## Public methods

### getMode

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

```
public final int getMode()
```

### toString

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

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

Note: Not intended for production use.