{ } { }

Jetpack SceneCore

Build and manipulate the Android XR scene graph with 3D content.
Latest Update Stable Release Release Candidate Beta Release Alpha Release
December 12, 2024 - - - 1.0.0-alpha01

Declaring dependencies

To add a dependency on XR SceneCore, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

dependencies {
    implementation "androidx.xr.scenecore:scenecore:1.0.0-alpha01"
    // Required for Java
    implementation "com.google.guava:listenableFuture:1.0"
    // Required for Kotlin
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.9.0"

    // Use to write unit tests
    testImplementation "androidx.xr.scenecore:scenecore-testing:1.0.0-alpha01"
}
dependencies {
    implementation("androidx.xr.scenecore:scenecore:1.0.0-alpha01")
    // Required for Java
    implementation("com.google.guava:listenableFuture:1.0")
    // Required for Kotlin
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.9.0")

    // Use to write unit tests
    testImplementation("androidx.xr.scenecore:scenecore-testing:1.0.0-alpha01")
}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.0

Version 1.0.0-alpha01

December 12, 2024

androidx.xr.scenecore:scenecore-* 1.0.0-alpha01 is released.

Features of Initial Release Initial developer release of Jetpack SceneCore, a 3D scene graph library for creating and manipulating immersive scenes and environments. This library allows you to place and arrange 3D models and content panels relative to each other and your virtual or real-world environments.

  • SpatialEnvironment: Create fully immersive experiences with a skybox image and/or 3D model geometry as the backdrop for your XR scene of your environment. Or enable passthrough, so your virtual scene can integrate with the user’s real-world environment.
  • PanelEntity: Add 2D content to your 3D scenes by embedding standard Android layouts and Activities into spatialized panels that can float or be anchored to real-world surfaces.
  • GltfModelEntity: Place, animate, and interact with 3D models in your scene. SceneCore supports the glTF file format for ease of integration with existing models.
  • SpatialAudio: Add ambient and point audio sources into your 3D scene for fully immersive, spatialized sound.
  • StereoSurfaceEntity: SceneCore supports left/right eye routing of content rendered onto an Android Surface. This can be used to render stereoscopic content in a side-by-side or top-bottom format, such as stereo photos, 3D video, or other dynamically rendered UIs. Applications should use MediaPlayer or ExoPlayer for video decoding.
  • Component System: SceneCore offers a robust and flexible component system for adding capabilities to your XR content, including affordances for users to move, resize, and interact with models and panels.
  • Anchor: With passthrough enabled, you can attach panels and models to actual surfaces, giving users seamless integration of virtual content in their real-world environment.
  • User Pose: Access the user’s location in the virtual scene, to orient your content around the user’s position.
  • SpatialCapabilities: Build fully adaptive apps that take advantage of spatialized capabilities when available, such as 3D positioning of UI content. Not only that, but your app can monitor for changes to capabilities while the app is executing, to modify the experience based on how the user is using their Android XR device.

Known Issues

  • Currently a minSDK of 30 is required to use Jetpack SceneCore. As a workaround add the following manifest entry <uses-sdk tools:overrideLibrary="androidx.xr.scenecore, androidx.xr.compose"/> to be able to build and run with a minSDK of 23.
  • Session can become invalid in various situations that automatically recreate the Activity, including resizing a main panel, connecting peripherals, and changing between light and dark mode. If you encounter session invalidation issues, workarounds include making you main panel non-resizable, using a dynamic panel entity, disabling activity recreation for specific config changes or disabling light/dark mode theme changes.
  • Movable and Resizable components are not supported on GltfEntity.
  • Entity.getSize() is not supported on GltfEntity.
  • Jetpack XR apps required to request android.permission.SCENE_UNDERSTANDING permission in AndroidManifest.
  • Creating a session is only supported on an Android XR device. At this time, if you create a Session and try to use it on a non Android XR device, you'll get a RuntimeException.
  • Setting the skybox to null via `SpatialEnvironment.setSpatialEnvironmentPreference() does not result in a solid black skybox as documented. It may result in the system default skybox or no change to the current skybox.
  • SceneCore clients should add implementation(“com.google.guava:listenablefuture-1.0”) to their Gradle configuration for their app’s dependencies. In a future release, scenecore will include this library as an api dependency so clients will not need to explicitly declare it.
  • SceneCore erroneously includes com.google.guava:guava-31.1-android and com.google.protobuf:protobuf-javalite as transitive dependencies. If this results in duplicate class errors in your build, these two dependencies can be safely excluded.
  • If your app uses SceneCore and enables ProGuard, it will crash when you create a Session. As a workaround, disable ProGuard. See this guide for more information on how to enable ProGuard.

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Jul 24, 2023

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Feb 8, 2023

TV is a growing segment of Android devices that requires specific attention to app design and functionality in order to create a great experience.

Updated Nov 28, 2024