# 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)

*** ** * ** ***


```
public static class 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/androidx/xr/runtime/SpatialApiVersionProvider` implementations and reports the highest version number found.

## Summary

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/SpatialApiVersionHelper` | `https://developer.android.com/reference/androidx/xr/runtime/SpatialApiVersionHelper#INSTANCE()` |

| ### Public methods |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/xr/runtime/SpatialApiVersionHelper#getSpatialApiVersion()()` The version of the Android XR Spatial APIs available to Jetpack XR at runtime. |

## Public fields

### INSTANCE

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

```
public static @NonNull SpatialApiVersionHelper INSTANCE
```

## Public methods

### getSpatialApiVersion

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

```
public static final int getSpatialApiVersion()
```

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/androidx/xr/runtime/SpatialApiVersions`.

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