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. */)}
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-27 UTC"],[],[],null,["ARCore 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\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\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/5673ffc60b614daf028ee936227128eb8c4f9781/xr/src/main/java/com/example/xr/arcore/Hands.kt#L39-L48\n```\n\n\u003cbr /\u003e\n\nSee also\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)"]]