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. */)}
[null,null,["最后更新时间 (UTC):2025-08-23。"],[],[],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)"]]