Jetpack SceneCore
| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| October 22, 2025 | - | - | - | 1.0.0-alpha08 |
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:
Groovy
dependencies { implementation "androidx.xr.scenecore:scenecore:1.0.0-alpha08" // Optional dependencies for asynchronous conversions implementation "androidx.xr.scenecore:scenecore-guava:1.0.0-alpha08" // Use to write unit tests testImplementation "androidx.xr.scenecore:scenecore-testing:1.0.0-alpha08" }
Kotlin
dependencies { implementation("androidx.xr.scenecore:scenecore:1.0.0-alpha08") // Optional dependencies for asynchronous conversions implementation("androidx.xr.scenecore:scenecore-guava:1.0.0-alpha08") // Use to write unit tests testImplementation("androidx.xr.scenecore:scenecore-testing:1.0.0-alpha08") }
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.
See the Issue Tracker documentation for more information.
Version 1.0
Version 1.0.0-alpha08
October 22, 2025
androidx.xr.scenecore:scenecore-*:1.0.0-alpha08 is released. Version 1.0.0-alpha08 contains these commits.
API Changes
- Renamed
ActivityPanelEntity.moveActivitytotransferActivity(I273c5, b/430332856)
Bug Fixes
:xr:scenecore:scenecore-spatial-renderingand:xr:scenecore:scenecore-spatial-coreadded as implementation dependency of:xr:scenecore:scenecore(I6ab65, b/447000520)- Exception is thrown if
session.sceneis accessed after session destruction. (I77e6f)
Version 1.0.0-alpha07
September 24, 2025
androidx.xr.scenecore:scenecore:1.0.0-alpha07, androidx.xr.scenecore:scenecore-guava:1.0.0-alpha07, and androidx.xr.scenecore:scenecore-testing:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.
API Changes
- Renamed
fixedAspectRatiotoisFixedAspectRatioEnabledand made it a boolean property (I5c4e8, b/440588971) ScenecoreFakes are now located inxr:scenecore:scenecore-testingmodule. (Idd951)- Renamed
shouldAutoHideContenttoisAutoHideContentWhileResizingEnabledandshouldAlwaysShowOverlaytoisAlwaysShowOverlayEnabled(I97c36, b/432335421) - Updated
SceneCoreTextureSamplerconstants for readability, for exampleTextureSampler.MinFilter.LINEARis nowTextureSampler.MIN_FILTER_LINEAR(Ib159c) - Scene's
setKeyEntitysetter has been merged into thekeyEntityvariable. Setting thekeyEntityto an unmovable Entity such asAnchorEntitywill throw anIllegalArgumentExceptioninstead of returning a boolean false. (I62080, b/428721695, b/422215745) - Scene's
SpatialModeChangeListenervariable was replaced withsetSpatialModeChangedListener. It takes in aConsumer<SpatialModeChangeEvent>instead of aSpatialModeChangedListener.setSpatialModeChangedListenercan now optionally take in an Executor. (I62080, b/428721695, b/422215745) - Removed the
bundleparameter fromActivityPanelEntity.startActivity(I64344, b/430332856, b/430333040) - Renamed
SpatializerConstants.SOURCE_TYPE_BYPASStoSpatializerConstants.SOURCE_TYPE_DEFAULT. (Ifc7fe, b/422215565) - Added
SpatialSoundPool.PLAY_FAILEDconstant. (Ifc7fe, b/422215565) - Added default arguments to
SpatialSoundPool.playmethods. (Ifc7fe, b/422215565) - Removed return value of setters in
SpatialAudioTrackBuilder. (Ifc7fe, b/422215565) - SurfaceEntity changes
SurfaceEntity.CanvasShaperenamedShapeSurfaceEntity.CanvasShape.Vr180HemisphererenamedHemisphereSurfaceEntity.CanvasShape.Vr360SphererenamedSphereSurfaceEntity.EdgeFeatheringParams.SmoothFeatherrenamedRectangleFeatherSurfaceEntity.EdgeFeathingParams.SolidEdgerenamedNoFeatheringSurfaceEntity.ContentSecurityLevelrenamedSurfaceProtectionSurfaceEntity.ContentSecurityLevel.{values}added aSURFACE_PROTECTION_prefix.SurfaceEntity.SuperSampling.{$values}added aSUPER_SAMPLING_prefixSurfaceEntity.StereoMode.{values}added aSTEREO_MODE_prefixSurfaceEntity.ContentColorMetadata.maxCLLrenamedmaxContentLightLevel(I7eb5f, b/422216050, b/427529950)
- Renamed
launchActivitytostartActivity(I7db90, b/430332856) - Removed
Scene.activitySpaceRoot. UseScene.activitySpaceinstead. (I05ee8, b/378706624, b/422215745) configureBundleForFullSpaceModeLaunchandconfigureBundleForFullSpaceModeLaunchWithEnvironmentInheritedrenamed tocreateBundleForFullSpaceModeLaunchandcreateBundleForFullSpaceModeLaunchWithEnvironmentInheritedrespectively, and moved to LaunchUtils.kt file as top-level methods and take Session as first param (I64a2c, b/437186050)GroupEntityfactory now returnsGroupEntitytype instead of Entity. (I66042)
Bug Fixes
- Throw an
IllegalStateExceptionwhen an entity instance is used after dispose. (I90990, b/427314036, b/432063442)
Version 1.0.0-alpha06
August 13, 2025
androidx.xr.scenecore:scenecore:1.0.0-alpha06, androidx.xr.scenecore:scenecore-guava:1.0.0-alpha06, and androidx.xr.scenecore:scenecore-testing:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.
API Changes
- Unrestrict
SceneCore'sBaseEntityandBaseScenePoseAPIs (88c0ff6)
Version 1.0.0-alpha05
July 30, 2025
androidx.xr.scenecore:scenecore-guava:1.0.0-alpha05, androidx.xr.scenecore:scenecore-testing:1.0.0-alpha05, and androidx.xr.scenecore:scenecore:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.
New Features
- Perceived Resolution API added to Panel Entities and
SurfaceEntities. (I118f6) PerceivedResolutionCallback methods added to Scene.kt to monitor the perceived resolution of the main panel of the activity in HSM. (I58084)SurfaceEntity- Support added for Application to request super sampling at creation time. This allows applications to use super sampling filter for anti-aliasing. (I06913)- Added
recommendedContentBoxInFullSpaceproperty toActivitySpace. It returns a recommended box for content to be placed in when in Full Space Mode. (I4cd6f) - Provided overloaded constructor for movable modifier which allows anchoring. (Ic0c70)
API Changes
Extensive API changes were made to SceneCore for this release. Several classes have been renamed and/or moved to different modules, and most getter/setter methods have been replaced with Kotlin properties. While we anticipate future breaking API changes until our first Beta release, they will not be as disruptive or numerous.
- Renamed and/or moved the following classes & interfaces:
androidx.xr.scenecore.PixelDimensionstoandroidx.xr.runtime.math.IntSize2d;androidx.xr.scenecore.Dimensionstoandroidx.xr.runtime.math.FloatSize3d;androidx.xr.scenecore.ActivityPosetoScenePose,androidx.xr.scenecore.ContentlessEntitytoGroupEntity,androidx.xr.scenecore.PlaneTypetoPlaneOrientation;androidx.xr.scenecore.PlaneSemantictoPlaneSemanticType. (Ifd405)(I3b622) (If534d) - A number of setters for
Scene's properties have been made private; they were not intended to be mutated bySceneCoreclients:activitySpace,activitySpaceRoot,mainPanelEntity,perceptionSpace,spatialCapabilities,spatialEnvironment, andspatialUser. (I2f506) - In Entity: Changed the following to properties:
get/setParent(),setContentDescription; DeprecatedEntity.is/setHidden(), useEntity.is/setEnabledinstead. (Ibc4c6) - Removed the
androidx.xr.scenecore.BasePanelEntityclass, usePanelEntitydirectly instead. Replaced getters and setters forPanelEntitywith properties. ChangedPanelEntity.sizeproperty fromFloat3dSizetoFloat2dSize. Remmoved the deprecated methodandroidx.xr.scenecore.PanelEntity.getPixelDimensions, usegetSizeInPixelsinstead. (Icc174) - Replaced
androidx.xr.scenecore.OnSpaceUpdatedListenerwithRunnable. (I19308) - Replaced
SpatialUser.getCameraViews()with a property. (Ib0cc5) ForExrImageandGltfModel:Changedcreatemethods to be suspend functions; modified create parameters to accept aUriorPathinstead of aString. (Id8883) (I0d247), (I25706) - Moved
SpatialEnvironment.requestFullSpaceModeandSpatialEnvironment.requestHomeSpaceModeto Scene, for example usesession.scene.requestFullSpaceMode()instead ofsession.scene.spatialEnvironment.requestFullSpaceMode().addOnPassthroughOpacityChangedListenerandaddOnSpatialEnvironmentChangedListenernow have overrides that accept optional Executors. (I12fe0) (I6b21e) - Removed the following deprecated
SpatialEnvironmentmethods:togglePassthrough,setPassthrough,setPassthroughOpacity,getPassthroughMode,getPassthroughOpacity,setSkybox, andsetGeometry. Also removed deprecated classSpatialEnvironment.PassthroughMode(I927bd) (I927bd) (I927bd) - Replaced the following
SpatialEnvironmentgetters and setters with Kotlin properties:getCurrentPassthroughOpacity(),get/setPassthroughOpacityPreference(),get/setSpatialEnvironmentPreference(),isSpatialEnvironmentPreferenceActive()(I33a7b) (Ie06e2) (Ie06e2) SpatialEnvironmentPreference.preferredPassthroughOpacitytype changed fromFloat?toFloat. It no longer accepts null values. Instead,SpatialEnvironment.NO_PASSTHROUGH_OPACITY_PREFERENCEis used to signal that there's no opacity preference. (I40107)- Updated the
windowBoundsPxparameter topixelDimensionsand its type from Rect toIntSize2din the create method. (I1926e) SpatialEnvironmentconstructor is now internal (I75a51)- Replaced class
SpatialPointerIconNoneandSpatialPointerIconCircleclasses with companion objectsSpatialPointerIcon.NONEandSpatialPointerIcon.CIRCLE(I416d2) SpatialPointerIconinSpatialPointerComponentis no longer nullable. UseSpatialPointerIcon.DEFAULTinstead of null to indicate that the system default pointer icon should be used. (I416d2)- Replaced
androidx.xr.scenecore.AnchorEntity.getState()with a read-only property. Renamed parameters on theAnchorEntity.create()method for clarity. InAnchorEntity's methods for setting and adding listeners, the listener has been moved to the final argument to enabled trailing lambdas. Replacedandroidx.xr.scenecore.OnStateChangedListenerforAnchorEntitywithConsumer<AnchorEntity.State>. (I472e0) GltfModelEntity.getAnimationState()is now a property. (I10b29)- Replaced
ActivitySpace.getBounds()with a property. RenamedActivitySpace.addBoundsChangedListenertoActivitySpace.addOnBoundsChangedListener. ReplacedActivitySpace.setOnSpaceUpdatedListenerwith add/remove methods. (I4c956) - For
AnchorPlacement: planeTypeFilterwas renamed toanchorablePlaneOrientations,planeSemanticFilterwas renamed toanchorablePlaneSemanticTypes. Add aMovableComponentto anAnchorEntityorActivitySpacewill return false,MoveListenerwas renamed toEntityMoveListener shouldDisposeParentAnchorwas renamed todisposeParentOnReAnchor systemMovablewas removed from thecreatefunction in favor ofcreeateCustomMovable,createSystemMovableandcreateAnchorable(If11c4) - Removed
SurfaceEntity.featherRadiusX/Yand adds anEdgeFeatheringParamsclass concept. (Ic78fc) PanelEntity.enablePanelDepthTest()method replaced withpanelClippingConfigproperty. SetScene.panelClippingConfig = PanelClippingConfig(isDepthTestEnabled = true)to enable depth-testing or set it toPanelClippingConfig(isDepthTestEnabled = false)to disable it. (I0cbe0)Scene.mainPanelEntityis now of typeMainPanelEntityinstead ofPanelEntity(I7125a)- Renamed Scene's
setFullSpaceModemethod toconfigureBundleForFullSpaceModeLaunchandsetFullSpaceModeWithEnvironmentInheritedmethod toconfigureBundleForFullSpaceModeLaunchWithEnvironmentInherited. (I0cbe0) (I0cbe0) - Renamed
SpatialVisibility's UNKNOWN, OUTSIDE_FOV, PARTIALLY_WITHIN_FOV, and WITHIN_FOV values to SPATIAL_VISIBILITY_UNKNOWN, SPATIAL_VISIBILITY_OUTSIDE_FIELD_OF_VIEW, SPATIAL_VISIBILITY_PARTIALLY_WITHIN_FIELD_OF_VIEW, and SPATIAL_VISIBILITY_WITHIN_FIELD_OF_VIEW, respectively (Ie7e8c) SpatialVisibilityclass replaced with public object with const Int values.setSpatialVisibilityChangedListenernow accepts aConsumer<Int>instead ofConsumer<SpatialVisibility>(Ie7e8c)PointerCaptureComponentconstants renamed and moved toPointerCaptureComponent.PointerCaptureStateobject (I9c7ac)- Replaced
PointerCaptureComponents' StateListenerwithConsumer<Int>. (I9c7ac) - Replaced
InputEventListenerwithConsumer<InputEvent>(I9c7ac) setPreferredAspectRatiomoved from Scene class toSpatialWindowobject and takes in Session as first parameter. (I7b717)Entity.setHidden()replaced byEntity.setEnabled()andEntity.isHidden()replaced byEntity.isEnabled().setHidden(false)is equal tosetEnabled(true)andisHidden() == !isEnabled(). (Icf0de)Entity.contentDescriptiontype changed from String toCharSequence. (Ie59be)Session.createandSession.configurenow throwSecurityExceptionwhen sufficient permissions have not been granted instead of returningSessionCreatePermissionsNotGrantedorSessionConfigurePermissionsNotGranted. (I7c488)ResizableComponent.createnow requires aConsumer<ResizeEvent> ResizeEventListenerwas replaced withConsumer<ResizeEvent> ResizableComponent.sizewas renamed toResizableComponent.affordanceSize ResizableComponent.minimumSizewas renamed toResizableComponent.minimumEntitySize ResizableComponent.maximumSizewas renamed toResizableComponent.maximumEntitySize,ResizableComponent.autoHideContentwas renamed toResizableComponent.shouldAutoHideContentResizableComponent.forceShowResizeOverlaywas renamed toResizableComponent.shouldAlwaysShowOverlay(I97a2d)- Reduced
minSDKto 24 forandroidx.xr.scenecoreandandroidx.xr.compose. XR packages still require API 34 at runtime. (I17224) - Removed
RequiresApi(34)restriction on all Jetpack XR packages. This restriction was redundant as Jetpack XR is currently only available on devices with API level 34+. (Iae0f8) - The main
SceneCoreartifact (xr:scenecore:scenecore) will only contain Kotlin-style async APIs. Java developers can depend on thexr:scenecore:scenecore-guavalibrary to access compatible APIs. (If221b) - Projects released with Kotlin 2.0 require KGP 2.0.0 or newer to be consumed (Idb6b5)
- This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage:
-Xjspecify-annotations=strict(this is the default starting with version 2.1.0 of the Kotlin compiler) (Ia8420) - All async methods that return
ListenableFuturehave been replaced with Kotlin suspend functions. Java developers that wish to useListenableFuture-based async methods instead Kotlin suspend functions must now use extension functions in:xr:scenecore-scenecore-guava. For example,GuavaExrImagecontains the Guava-equivalent ExrImage async functions,GuavaScenePosecontains the Guava-equivalentScenePoseasync functions,GuavaGltfModelcontains theGuava-equivalent GltfModelasync functions, etc. (If7283) (I0af60) (If7283) (Ia8515) (I4efdf) (I54bbf) (I3467a) (I82a33)
Bug Fixes
- Updated Jetpack XR Scenecore
ProGuardrule to preventAbstractMethodErrorfor minified clients. (I91a01) - Additional fixes to support Proguard minification for Jetpack XR
SceneCore(I4f47e) - Fixed a bug where an
InteractableComponentmay cause a crash if thehitPositionon the HitInfo of theInputEventmay crash if thehitPositionreturned from the system was null (I7a695) - Config *Mode vals have been renamed to reflect their behavior. (I6d247)
- Fixed issues with FOV and
HitTestinSceneCoreTestApp. (I2c51e) - Fixed bug in
SpatialCapabilities.hasCapability()where it would return true if any of the capabilities passed in with a bitwise OR was true instead of only returning true if they were all true. (I2cd40) SurfaceEntity.StereoMode.TOP_BOTTOMupdated to have the top map to the left eye and the bottom map to the right eye. (I4ae68)
Version 1.0.0-alpha04
May 7, 2025
androidx.xr.scenecore:scenecore:1.0.0-alpha04 and androidx.xr.scenecore:scenecore-testing:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.
New Features
- Backhandling will now work on panel entities without embedded activities. For backhandling to work you need to specify
android:enableOnBackInvokedCallback= "true"in the android manifest. StereoSurfaceEntitynow supports MV-HEVC playback through two newStereoModevalues: MULTIVIEW_LEFT_PRIMARY and MULTIVIEW_RIGHT_PRIMARY.PanelEntity.setSizeandPanelEntity.getSizenow return sizes in parent space.Entity.setPose,Entity.getPose,Entity.setScale,Entity.getScale,Entity.setAlphaandEntity.getAlphanow take a new paramrelativeTo, which allows get/set values relative to different spaces. The supported values are Parent, Activity and Real World spaces, and the default value for this param is Parent.- Spatial Visibility Callback extension methods added to
SessionExt.ktto monitor when the scene content moves inside or outside the user's field of view. setPointSourceParamshas been added toSpatialAudioTrack, allowing the params to be updated after the track has been built.- Added a new class, Scene, with references to
ScenecoreAPIs. Scene will be accessible as an extension property of Session. Functions inside ofSessionExthave been moved to Scene so imports will be need to be adjusted; for example,SessionExt.getScene(session).addSpatialCapababilitiesChangedListenerversusSessionExt.addSpatialCapabilitiesChangedListener. ActivityPose.hitTestAsyncwas added, enabling ahitTestagainst virtual content.- Added new Component type
SpatialPointerComponent, allowing clients to specify the icon rendered for the pointer, or to disable the icon. This Component can currently be attached toPanelEntityinstances only. - Introducing new
PanelEntityfactory, which takes panel dimensions in either meters or pixels. OlderPanelEntityfactory taking two Dimension type params for panel removed.
API Changes
- Removed
RequiresApi(34)restriction on all Jetpack XR packages. This restriction was redundant as Jetpack XR is currently only available on devices with API level 34+. (Iae0f8) - Projects released with Kotlin 2.0 require KGP 2.0.0 or newer to be consumed (Idb6b5)
PermissionHelperclass has been removed.PanelEntity.getPixelDensityis deprecated.PanelEntity.setPixelDimensionsandPanelEntity.getPixelDimensionare removed, replaced bysetSizeInPixelsandgetSizeInPixels.Entity.getActivitySpaceAlpharemoved. Can be replaced withEntity.getAlpha(Space.Activity).Entity.getWorldSpaceScaleremoved. Can be replaced withEntity.getScale(Space.REAL\_WORLD).- The Session class in
SceneCorehas been deleted in favor of the Session in XR Runtime. StereoSurfaceEntityhas been renamed toSurfaceEntity.Entity.setSizeandEntity.getSizeare removed, and the same methods were added toPanelEntity.PointSourceAttributeshas been renamed toPointSourceParams.SpatializerConstants.SOURCE\_TYPE\_BYPASShas been renamed toSpatializerConstants.SOURCE\_TYPE\_DEFAULT.PointSourceParamsentity has been modified from public to internal access.AnchorEntity.createnow requiresPlaneTrackingModeto be configured inSession.configure().SpatialUserAPIs now requireHeadTrackingModeto be configured inSession.configure().- When
ResizableComponentis not attached, it will give INFO-level log instead of ERROR-level log. - Fov class is now a regular Kotlin class.
- Split
Entity.ktto place each concrete entity type into its own file. - When creating a new
PanelEntity, most Views will be reparented to aFrameLayout. This facilitates the use ofLayoutInspectorwith Spatial Panels. - The currently used
XrExtensionsinstance is now registered with the platform, in a best effort way, to help with app debugging.
Bug Fixes
- A fix was added to prevent a crash that could occur when a
PanelEntitywithMovableComponentandAnchorPlacementwas moved - Fixed an issue where
ResizableComponentwas providing stale sizes inonResizeStartcallback. - Fixed crash when
JxrPlatformAdapterAxr'sdispose()was called multiple times.
Version 1.0.0-alpha03
February 26, 2025
androidx.xr.scenecore:scenecore:1.0.0-alpha03 and androidx.xr.scenecore:scenecore-testing:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.
New Features
- Proguard minification is now supported for Jetpack XR code
Bug Fixes
- Additional fixes to support Proguard minification for Jetpack XR SceneCore (I4f47e)
- Updated Jetpack XR Scenecore
ProGuardrule to preventAbstractMethodErrorfor minified clients. (I91a01)
Version 1.0.0-alpha02
February 12, 2025
androidx.xr.scenecore:scenecore:1.0.0-alpha02 and androidx.xr.scenecore:scenecore-testing:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.
Upcoming breaking change affecting apps built before 1.0.0-alpha02
- Factory methods have been moved from the
Sessionclass to a companion method on each respective type:Session.createActivityPanelEntity(Dimensions, String, Activity, Pose)has been deleted and replaced withActivityPanelEntity.create(Session, Dimensions, String, Pose)Session.createAnchorEntity(Anchor)has been deleted and replaced withAnchorEntity.create(Session, Anchor)Session.createAnchorEntity(Dimensions, Int, Int, Duration)has been deleted and replaced withAnchorEntity.create(Session, Dimensions, Int, Int, Duration)Session.createEntity(String, Pose)has been deleted and replaced withContentlessEntity.create(Session, String, Pose)Session.createExrImageResource(String)has been deleted and replaced withExrImage.create(Session, String)Session.createGltfEntity(GltfModel, Pose)has been deleted and replaced withGltfModelEntity.create(Session, GltfModel, Pose)Session.createGltfModelResource(String)has been deleted and replaced withGltfModel.create(Session, String)Session.createInteractableComponent(Executor, InputEventListener)has been deleted and replaced withInteractableComponent.create(Session, Executor, InputEventListener)Session.createMovableComponent(Boolean, Boolean, Set<AnchorPlacement>, Boolean)has been deleted and replaced withMovableComponent.create(Session, Boolean, Boolean, Set<AnchorPlacement>, Boolean)Session.createPanelEntity(View, Dimensions, Dimensions, String, Pose)has been deleted and replaced withPanelEntity.create(Session, View, Dimensions, Dimensions, String, Pose)Session.createResizableComponent(Dimensions, Dimensions)has been deleted and replaced withResizableComponent.create(Session, Dimensions, Dimensions)Session.createStereoSurfaceEntity(Int, Dimensions, Pose)has been deleted and replaced withStereoSurface.create(Session, Int, Dimensions, Pose)
- The following deprecated methods were removed:
Session.canEmbedActivityPanel(Activity)has been deleted. UsegetSpatialCapabilities.hasCapabilility(SPATIAL_CAPABILITY_EMBED_ACTIVITY)instead.Session.hasSpatialCapability(Int)has been deleted. It has been replaced in favor of usinggetSpatialCapabilities().hasCapability()as a more compartmentalized way to check for the presence of spatial capabilities sincegetSpatialCapabilities()returns aSpatialCapabilitiesobject.Session.requestFullSpaceMode()has been deleted and replaced withSpatialEnvironment.requestFullSpaceMode()Session.requestHomeSpaceMode()has been deleted and replaced withSpatialEnvironment.requestHomeSpaceMode()
Session.setFullSpaceMode(Bundle)andSession.setFullSpaceModeWithEnvironmentInherited(Bundle)have been moved to extension functions. Developer files will need to add the new imports for access:import androidx.xr.scenecore.setFullSpaceModeimport androidx.xr.scenecore.setFullSpaceModeWithEnvironmentInherited
Session.setPreferredAspectRatio(Activity, Float)has been moved to an extension function. Developer files will need to add the new import for access:import androidx.xr.scenecore.setPreferredAspectRatio
Session.getEntitiesOfType(Class<out T>)andSession.getEntityForRtEntity(RtEntity)have been moved to extension functions. Developer files will need to add the new imports for access:import androidx.xr.scenecore.getEntitiesOfTypeimport androidx.xr.scenecore.getEntityForRtEntity
Session.unpersistAnchor(Anchor)has been deletedSession.createPersistedAnchorEntity(UUID)has been deleted
Known issues
PanelEntity.setCornerRadius()andActivityPanelEntity.setCornerRadius()may not take effect until the panel is next moved, this can be mitigated by moving the panel to its current position- When
BoundsChangedis called on theActivitySpace, someActivityPoses may not have been correctly updated. It will be updated on the followingOnSpaceUpdatedcall on theActivitySpace
Breaking & behavioral changes
PanelEntityandActivityPanelEntitywill have a default corner radius of 32dp or smaller if the panel has a width or height smaller than 32dp
New APIs and capabilities
- Introduces
StereoSurface.CanvasShape, which allows for the creation ofSphericalandHemisphericalcanvases for rendering immersive media. StereoSurfaceEntity.create()now accepts aCanvasShapeparameter. (This parameter is currently ignored, but will be used in a future release)StereoSurfaceEntity.create()no longer takes aDimensionsparameter. Applications should control the size of the canvas through setting theCanvasShapeStereoSurfaceEntityhas aCanvasShapemember which can be set dynamically.StereoSurfaceEntity.dimensionsis now a read-only property; applications should set theCanvasShapeto change dimensions.StereoSurfaceEntitynow allows theStereoModeto be re-set after construction.
Other changes
- Reduced compile-time minSDK to 24. All Jetpack XR APIs continue to require API 34 at runtime.
SceneCore's Session factory (Session.create) no longer launches an intent to acquire theSCENE_UNDERSTANDINGpermission. Instead, the client application must explicitly request the permissions from the user, before attempting to create the anchors. Anchor creation will fail if the permission is not granted by the user.
Bug fixes
getActivitySpacePose()has been fixed to account for theActivitySpacescale by returning translation values in scaled meters rather than always returning non-scaled meters.transformPoseTonow also uses the right units to compute coordinate changes when theActivitySpaceis involved in the source or destination.- The skybox will now be set to an all-black skybox whenever a null skybox preference is passed using
setSpatialEnvironmentPreference(new SpatialEnvironmentPreference(null, geom)). To revert to the system default skybox and geometry, usesetSpatialEnvironmentPreference(null).
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_UNDERSTANDINGpermission 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 anapidependency so clients will not need to explicitly declare it. - SceneCore erroneously includes
com.google.guava:guava-31.1-androidandcom.google.protobuf:protobuf-javaliteas 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.