Stay organized with collections
Save and categorize content based on your preferences.
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.
Access a Session
A Session must be created when using ARCore for Jetpack XR.
When using Jetpack Compose for XR, use 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 that your Session needs. For example, to enable
hand tracking, the HandTrackingMode is set to the
HandTrackingMode.BOTH mode:
valnewConfig=session.config.copy(handTracking=Config.HandTrackingMode.BOTH)when(valresult=session.configure(newConfig)){isSessionConfigureConfigurationNotSupported->
TODO(/* Some combinations of configurations are not valid. Handle this failure case. */)isSessionConfigureSuccess->TODO(/* Success! */)else->
TODO(/* A different unhandled exception was thrown. */)}
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-31 UTC."],[],[],null,["# Work with ARCore for Jetpack XR\n\nARCore for Jetpack XR allows apps to work with basic concepts of augmented\nreality (AR), using low-level scene understanding primitives and motion\ntracking. Use ARCore for Jetpack XR when building AR experiences and you need to\nuse planar data or anchor content to a fixed location in space.\n| **Preview:** ARCore for Jetpack XR is currently only available on Android XR devices.\n\nAccess a `Session`\n------------------\n\nA `Session` must [be created](/develop/xr/jetpack-xr-sdk/add-session#access-session) when using ARCore for Jetpack XR.\n\nWhen using Jetpack Compose for XR, use [`LocalSession`](/reference/kotlin/androidx/xr/compose/platform/package-summary#LocalSession()) to access the session\nthat is created for you.\n\nConfigure a `Session`\n---------------------\n\nSome features may be disabled by default and must be configured in order to\nfunction. To configure a session, use `configure()` and specify [the\nconfiguration options](/reference/kotlin/androidx/xr/runtime/Config) that your `Session` needs. For example, to enable\n[hand tracking](/develop/xr/jetpack-xr-sdk/arcore/hands), the `HandTrackingMode` is set to the\n[`HandTrackingMode.BOTH`](/reference/kotlin/androidx/xr/runtime/Config.HandTrackingMode#BOTH()) mode:\n\n\n```kotlin\nval newConfig = session.config.copy(\n handTracking = Config.HandTrackingMode.BOTH\n)\nwhen (val result = session.configure(newConfig)) {\n is SessionConfigureConfigurationNotSupported -\u003e\n TODO(/* Some combinations of configurations are not valid. Handle this failure case. */)\n is SessionConfigureSuccess -\u003e TODO(/* Success! */)\n else -\u003e\n TODO(/* A different unhandled exception was thrown. */)\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/xr/src/main/java/com/example/xr/arcore/Hands.kt#L39-L48\n```\n\n\u003cbr /\u003e\n\nSee also\n--------\n\n- [Work with Anchors using ARCore for Jetpack XR](/develop/xr/jetpack-xr-sdk/arcore/anchors)\n- [Work with Planes using ARCore for Jetpack XR](/develop/xr/jetpack-xr-sdk/arcore/planes)\n- [Work with Hands using ARCore for Jetpack XR](/develop/xr/jetpack-xr-sdk/arcore/hands)"]]