ARCore for Jetpack XR
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:
dependencies { implementation "androidx.xr.arcore:arcore:1.0.0-alpha01" }
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.
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 aLabel
that describes it semantically. You can usesubscribe
to be notified about the latest detected planes orstate
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 (usingcreate
) or aTrackable
(usingcreateAnchor
).Anchors can be reused across sessions. You can use
persist
to store them,getPersistedAnchorUuids
to enumerate them andload
to retrieve them. Make sure that youunpersist
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 usegetAnchor
to retrieve its backing anchor.Offer natural user interactions using
hitTest
. A hitTest uses aRay
to determine which contents it intersects and to create anAnchor
from that location. Consider conducting a hitTest from anInputEvent
.
Known Issues
There might be a delay between calling
unpersist
and its UUID being removed from the results returned bygetPersistedAnchorUuids
.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 callingpersist
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 topersist
with atry
block as a workaround.