Android Developers Blog
The latest Android and Google Play news for app and game developers.
🔍
Platform Android Studio Google Play Jetpack Kotlin Docs News

19 May 2026

Updates to the Android XR SDK: Introducing Developer Preview 4


Link copied to clipboard
Posted by Stevan Silva, Group Product Manager and Amy Zeppenfeld, Developer Relations Engineer


Today we're excited to launch Developer Preview 4 of the Android XR SDK, continuing our focus on unifying cross-device development for headsets, wired XR glasses, and intelligent eyewear. To keep our platform intuitive, we are adopting more descriptive naming for our form factors, where AI glasses are now audio glasses and display AI glasses are now display glasses, with these changes appearing in our documentation starting today.

This release is packed with updates that help you build incredible experiences for XR devices, enable deeper immersive experiences on XR headsets, and streamline the path for creating augmented experiences on audio and display glasses. Also, our core libraries—including XR Runtime, Jetpack SceneCore, and ARCore for Jetpack XR— will be officially moving to Beta soon!

To give you early access to hardware and resources for building immersive and augmented experiences on upcoming devices—like display and audio glasses and XREAL’s Project Aura — we’re announcing the Android XR Developer Catalyst Program. Learn more and start your application today.

Building Augmented Experiences for Audio and Display Glasses

Starting out with our libraries for augmented experiences, Developer Preview 4 introduces new APIs that help you create and test your apps.

Jetpack Projected: Device Availability and ProjectedTestRule APIs

The Jetpack Projected library helps bridge app experiences from the phone to the user's field of view. We've added the Device Availability API, which consolidates wear state and connectivity signals into standard Android Lifecycle.State values. This lets you adjust your applications behavior based on whether the device is worn.

val xrDevice = XrDevice.getCurrentDevice(projectedContext)

// Observe the device lifecycle flow
xrDevice.getLifecycle().currentStateFlow
    .collect { state ->
        when (state) {
            Lifecycle.State.STARTED -> { /* Device is available (worn) */ }
            Lifecycle.State.CREATED -> { /* Device is unavailable (not worn) */ }
            Lifecycle.State.DESTROYED -> { /* Device is DISCONNECTED */ }
        }
    }
  

To simplify testing, the new ProjectedTestRule API in the projected-testing artifact automates the setup of projected test environments. This helps you write clean, reliable unit tests without the boilerplate code.

// from the 'androidx.xr.projected:projected-testing:1.0.0-alpha07' artifact
@get:Rule
val projectedTestRule = ProjectedTestRule()

@Test
fun testProjectedContextInitialization() {
    // by default, ProjectedTestRule automatically creates and connects
    // a projected device before each test
    val projectedContext = ProjectedContext.createProjectedDeviceContext(context)

    // assert the projected context is successfully initialized
    assertThat(projectedContext).isNotNull()
}
  
Jetpack Compose Glimmer: Google Sans Flex and new components

Our UI library for display glasses, Jetpack Compose Glimmer, now includes Google Sans Flex for improved legibility on optical see-through displays. We’ve also added several interactive components:

  • Stacks: Designed for touchpad-optimized groups, showing one item at a time.
  • Title Chips: Provides categorization and context for content cards.

Building Immersive Experiences for XR Headsets and Wired XR Glasses

If you're looking to build fully immersive experiences for XR Headsets and wired XR Glasses, we have several big updates.

Beta Transition & Modern Architecture

XR Runtime, Jetpack SceneCore, and the ARCore for Jetpack XR perception features (Depth Maps, Eye/Hand Tracking, Hit Testing, and Spatial Anchors) will soon move to Beta, so we’ve streamlined the Jetpack XR APIs. We've removed legacy Guava and RxJava3 packages in favor of a modern, Kotlin-first architecture.

Jetpack SceneCore: glTF and Custom Meshes

We're expanding 3D model capabilities by adding the ability to fine tune 3D models and access specific nodes with a 3D model. Using GltfModelNode, you can modify properties like pose, materials, and textures, and even run animations for specific nodes.

// Create a new PBR material
pbrMaterial = KhronosPbrMaterial.create(
    session = xrSession,
    alphaMode = AlphaMode.OPAQUE
)

// Load a texture.
val texture = Texture.create(
    session = xrSession,
    path = Path("textures/texture_name.png")
)

// Apply the texture and configure occlusion
pbrMaterial.setOcclusionTexture(
    texture = texture,
    strength = 0.5f
)

// Access the hierarchy of nodes
val entityNodes = entity.nodes

// Find the specific node
val myEntityNode = entityNodes.find { it.name == "node_name" }

// Apply the PBR material override
myEntityNode?.setMaterialOverride(
   material = newMaterial
)
  


We're also bringing Custom Meshes to SceneCore. Custom meshes let you build geometry on the fly programmatically, which is ideal for creating custom 3D models. This feature will launch as experimental, so try it out and let us know what you think!

 
// Create the mesh

val roadMesh =

    CustomMesh.BuilderFromMeshData(session, roadVertexLayout)

        .addVertexData(ByteBufferRegion(roadDataBuffer, 0, vertexDataSize))

        .setIndexData(ByteBufferRegion(roadDataBuffer, vertexDataSize, indexDataSize))

        .setTopology(MeshSubsetTopology.TRIANGLES)

        .build()


// Define the material

val roadMaterial = KhronosPbrMaterial.create(session, AlphaMode.OPAQUE)


// Instantiate the entity using the custom mesh and material

val roadEntity =

    MeshEntity.create(

        session,

        roadMesh,

        listOf(roadMaterial),

        pose = roadPose,

)


Compose for XR: Native glTF Support

We now have native glTF support directly in Compose for XR with SpatialGltfModel. Use this along with SpatialGltfModelState to access nodes and animations in the glTF model, or use them to add textures and materials to your 3D models.

   val myGltfModelState = rememberSpatialGltfModelState(
        source = SpatialGltfModelSource.fromPath(
            Paths.get("models/my_animated_model.glb")
        )
    )

    val myGltfAnimation =
        myGltfModelState.animations.find { it.name == "animation_name" }

    DisposableEffect(myGltfAnimation) {
        myGltfAnimation?.loop()

        onDispose {
            myGltfAnimation?.stop()
        }
    }

    SpatialGltfModel(state = myGltfModelState, modifier = modifier)
  

ARCore for Jetpack XR: Geospatial API Preview for Wired XR Glasses

We’re also providing an early preview of the Geospatial API for wired XR Glasses in ARCore for Jetpack XR. This update enables high-precision anchoring of digital content tied to real-world locations in over 87 countries.

By combining ARCore’s Visual Positioning System (VPS) with the reasoning and audio capabilities of the Gemini Live API, you can create contextually aware experiences that understand both the location and position of your user. Imagine building an immersive, AI-guided walking tour that provides real-time audio descriptions of nearby places, seamlessly blending digital information with the physical environment.


Start Building the Future Today

It's an amazing time to develop for Android XR. With the Jetpack XR SDK moving to Beta soon and a robust set of new tools at your fingertips, explore each of the following areas to get your app's experiences ready for XR!

Read the documentation, explore the samples, and check out the XR experiments

Head to the official Android Developer site for full technical guides, API reference, and instructions on setting up the new emulator. Get inspired with our samples and experiments. See how we've used these APIs to build immersive spatial layouts, load 3D models, explore spatial audio, and more!


Check out what's new for game engines

We've added official support for Unreal Engine and Godot, and we've launched two new tools to accelerate development for Android XR with Unity and the Android XR Interaction Framework. And, based on your feedback, we are introducing the Android XR Engine Hub to allow you to run your experiences directly from your preferred engine,


Apply for the Android XR Developer Catalyst Program

Don’t miss your chance to build for the latest Android XR hardware. Apply today for the opportunity to gain access to pre-release hardware, including our audio and display glasses prototype and XREAL’s Project Aura.

We look forward to seeing the amazing XR experiences you build as we move toward the launch of more Android XR devices later this year!

Explore this announcement and all Google I/O 2026 updates on io.google.