# SpatialApiVersionHelper

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/SpatialApiVersionHelper.kt+class:androidx.xr.runtime.SpatialApiVersionHelper) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-runtime#1.0.0)

*** ** * ** ***


```
object SpatialApiVersionHelper
```

<br />

*** ** * ** ***

Spatial API version supported by the device.

This object queries the underlying XR platform to determine which Spatial API versions are supported. It loads all available `https://developer.android.com/reference/kotlin/androidx/xr/runtime/SpatialApiVersionProvider` implementations and reports the highest version number found.

## Summary

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/SpatialApiVersionHelper#spatialApiVersion()` The version of the Android XR Spatial APIs available to Jetpack XR at runtime. |

## Public properties

### spatialApiVersion

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

```
val spatialApiVersion: Int
```

The version of the Android XR Spatial APIs available to Jetpack XR at runtime.

If the Spatial APIs are available, this value will be one of the constants declared in `https://developer.android.com/reference/kotlin/androidx/xr/runtime/SpatialApiVersions`.

Value is one of the following:

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

<br />

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if no `https://developer.android.com/reference/kotlin/androidx/xr/runtime/SpatialApiVersionProvider` service implementation is found |