Work with ARCore for Jetpack XR

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:

val newConfig = session.config.copy(     handTracking = Config.HandTrackingMode.BOTH ) when (val result = session.configure(newConfig)) {     is SessionConfigureConfigurationNotSupported ->         TODO(/* Some combinations of configurations are not valid. Handle this failure case. */)     is SessionConfigureSuccess -> TODO(/* Success! */)     else ->         TODO(/* A different unhandled exception was thrown. */) }

See also