ARCore for Jetpack XR

Bring digital content into the real world with perception capabilities.
Latest Update Stable Release Release Candidate Beta Release Alpha Release
December 12, 2024 - - - 1.0.0-alpha01

Declaring dependencies

To add a dependency on ARCore for Jetpack XR, 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.arcore:arcore:1.0.0-alpha01"
}

Kotlin

dependencies {
    implementation("androidx.xr.arcore:arcore: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.arcore:arcore-* 1.0.0-alpha01 is released.

Features of initial release

Inspired by the existing ARCore library, the ARCore for Jetpack XR library provides capabilities for blending digital content with the real world. This library includes motion tracking, persistent anchors, hit testing, and plane identification with semantic labeling (for example, floor, walls, and tabletops). View the developer guide to learn more about working with ARCore for Jetpack XR.

  • Session: ARCore for Jetpack XR uses the Jetpack XR Runtime under-the-hood to power its functionality. You will use a Session to interact with most ARCore for Jetpack XR APIs, so please take a look at its documentation.

  • Plane: Use planes to understand the world around you. Each plane has a Label that describes it semantically. You can use subscribe to be notified about the latest detected planes or state to be notified about the changes to a specific plane.

  • Anchor: A link between a virtual object and a real world location. Anchors can be attached to a specific location in space (using create) or a Trackable (using createAnchor).

    • Anchors can be reused across sessions. You can use persist to store them, getPersistedAnchorUuids to enumerate them and load to retrieve them. Make sure that you unpersist them once they are no longer in use.

    • Anchors are interoperable between ARCore for Jetpack XR and Jetpack SceneCore. You can create an AnchorEntity using an anchor or, if you have an existing AnchorEntity, you can use getAnchor to retrieve its backing anchor.

    • Offer natural user interactions using hitTest. A hitTest uses a Ray to determine which contents it intersects and to create an Anchor from that location. Consider conducting a hitTest from an InputEvent.

Known Issues

  • There might be a delay between calling unpersist and its UUID being removed from the results returned by getPersistedAnchorUuids.

  • create will not validate that the system has enough resources to return new anchors. Creating an excessive amount of anchors might lead to a crash.

  • Persisting an Anchor that was previously persisted and unpersisted is not currently supported.

  • Usage in the emulator is supported, but the behavior might not be as stable as when running on an actual device. Particularly, calls to create might fail with a native code error and immediately terminate the activity.

  • In certain circumstances, a RuntimeException might be erroneously thrown when calling persist with the message “Anchor was not persisted”. In those circumstances, the function would still succeed and the anchor will be persisted. We recommend wrapping the call to persist with a try block as a workaround.