ARCore for Jetpack XR allows apps to work with basic concepts of augmented
reality (AR), using low-level scene understanding primitives and motion
tracking. Use ARCore for Jetpack XR when building AR experiences and you need to
use planar data or anchor content to a fixed location in space.
| **Preview:** ARCore for Jetpack XR is currently only available on Android XR devices.

## Access a `Session`

A `Session` must [be created](https://developer.android.com/develop/xr/jetpack-xr-sdk/add-session#access-session) when using ARCore for Jetpack XR.

When using Jetpack Compose for XR, use [`LocalSession`](https://developer.android.com/reference/kotlin/androidx/xr/compose/platform/package-summary#LocalSession()) to access the session
that is created for you.

## Configure a `Session`

Some features may be disabled by default and must be configured in order to
function. To configure a session, use `configure()` and specify [the
configuration options](https://developer.android.com/reference/kotlin/androidx/xr/runtime/Config) that your `Session` needs. For example, to enable
[hand tracking](https://developer.android.com/develop/xr/jetpack-xr-sdk/arcore/hands), the `HandTrackingMode` is set to the
[`HandTrackingMode.BOTH`](https://developer.android.com/reference/kotlin/androidx/xr/runtime/Config.HandTrackingMode#BOTH()) mode:


```kotlin
val newConfig = session.config.copy(
    handTracking = Config.HandTrackingMode.BOTH
)
when (val result = session.configure(newConfig)) {
    is SessionConfigureSuccess -> TODO(/* Success! */)
    else ->
        TODO(/* The session could not be configured. See SessionConfigureResult for possible causes. */)
}https://github.com/android/snippets/blob/2f246fb3f712172fefe2e1761f3483568348bf90/xr/src/main/java/com/example/xr/arcore/Hands.kt#L38-L45
```

<br />

## See also

- [Work with Anchors using ARCore for Jetpack XR](https://developer.android.com/develop/xr/jetpack-xr-sdk/arcore/anchors)
- [Work with Planes using ARCore for Jetpack XR](https://developer.android.com/develop/xr/jetpack-xr-sdk/arcore/planes)
- [Work with Hands using ARCore for Jetpack XR](https://developer.android.com/develop/xr/jetpack-xr-sdk/arcore/hands)