The Android XR SDK is now available in Developer Preview. We want your feedback! Visit our
support page to reach out.
Stay organized with collections
Save and categorize content based on your preferences.
XRAnchorFeature
This OpenXRInteractionFeature configures new extensions XR_ANDROID_trackables
and XR_ANDROID_device_anchor_persistence
at runtime and provides XRAnchorSubsystem implementation that works on Android XR platform.
Note: due to the dependency on XRSessionFeature and XRTrackableFeature, its priority must be lower than session and trackable features so the feature registration happens after XrInstanceManager
and XrTrackableProvider
creation.
Summary
Inheritance
Inherits from:
OpenXRFeature
Public attributes
|
ExtensionStrings =
"XR_ANDROID_trackables " +
"XR_ANDROID_device_anchor_persistence"
|
const string
The OpenXR Extension string.
|
FeatureId = "com.google.xr.extensions.anchor"
|
const string
The feature ID string.
|
PersistentExtensionString = "XR_ANDROID_device_anchor_persistence"
|
const string
The OpenXR extensions for persistence feature.
|
UiName = "Android XR (Extensions): Anchor"
|
const string
The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.
|
Public static attributes
|
IsExtensionEnabled => _extensionEnabled
|
bool
Gets if the required OpenXR extension is enabled.
|
RequiredPermission =
AndroidXRPermission.SceneUnderstandingCoarse
|
Runtime permission required to enable scene understanding.
|
Properties
|
UsePersistence
|
bool
Gets or sets a value indicating whether to use persistence at runtime.
|
Public attributes
ExtensionStrings
const string ExtensionStrings =
"XR_ANDROID_trackables " +
"XR_ANDROID_device_anchor_persistence"
The OpenXR Extension string.
Used to check if this extensions is available or enabled. To enable runtime confiugration, always enabling persistence extension when it's available.
FeatureId
const string FeatureId = "com.google.xr.extensions.anchor"
PersistentExtensionString
const string PersistentExtensionString = "XR_ANDROID_device_anchor_persistence"
The OpenXR extensions for persistence feature.
Used to check if this extensions is available or enabled.
UiName
const string UiName = "Android XR (Extensions): Anchor"
The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.
Public static attributes
IsExtensionEnabled
bool IsExtensionEnabled => _extensionEnabled
Gets if the required OpenXR extension is enabled.
When OpenXR runtime is waiting, it returns null
. Otherwise, it indicates whether the XR_ANDROID_trackables extension is available on current device.
RequiredPermission
readonly AndroidXRPermission RequiredPermission =
AndroidXRPermission.SceneUnderstandingCoarse
Runtime permission required to enable scene understanding.
Properties
UsePersistence
bool UsePersistence
Gets or sets a value indicating whether to use persistence at runtime.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-04-16 UTC.
[null,null,["Last updated 2025-04-16 UTC."],[],[],null,["# XRAnchorFeature Class Reference\n\nXRAnchorFeature\n===============\n\nThis OpenXRInteractionFeature configures new extensions `XR_ANDROID_trackables` and `XR_ANDROID_device_anchor_persistence` at runtime and provides XRAnchorSubsystem implementation that works on Android XR platform.\n\nNote: due to the dependency on [XRSessionFeature](/develop/xr/unity/reference/class/Google/XR/Extensions/XRSessionFeature#classGoogle_1_1XR_1_1Extensions_1_1XRSessionFeature) and [XRTrackableFeature](/develop/xr/unity/reference/class/Google/XR/Extensions/XRTrackableFeature#classGoogle_1_1XR_1_1Extensions_1_1XRTrackableFeature), its priority must be lower than session and trackable features so the feature registration happens after `XrInstanceManager` and `XrTrackableProvider` creation.\n\nSummary\n-------\n\n### Inheritance\n\nInherits from: `OpenXRFeature`\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [ExtensionStrings](#extensionstrings)` = \"XR_ANDROID_trackables \" + \"XR_ANDROID_device_anchor_persistence\"` | `const string` The OpenXR Extension string. |\n| [FeatureId](#featureid)` = \"com.google.xr.extensions.anchor\"` | `const string` The feature ID string. |\n| [PersistentExtensionString](#persistentextensionstring)` = \"XR_ANDROID_device_anchor_persistence\"` | `const string` The OpenXR extensions for persistence feature. |\n| [UiName](#uiname)` = \"Android XR (Extensions): Anchor\"` | `const string` The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes. |\n\n| ### Public static attributes ||\n|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [IsExtensionEnabled](#isextensionenabled)` =\u003e _extensionEnabled` | `bool` Gets if the required OpenXR extension is enabled. |\n| [RequiredPermission](#requiredpermission)` = AndroidXRPermission.SceneUnderstandingCoarse` | `readonly `[AndroidXRPermission](/develop/xr/unity/reference/namespace/Google/XR/Extensions#androidxrpermission) Runtime permission required to enable scene understanding. |\n\n| ### Properties ||\n|-----------------------------------|-------------------------------------------------------------------------------|\n| [UsePersistence](#usepersistence) | `bool` Gets or sets a value indicating whether to use persistence at runtime. |\n\nPublic attributes\n-----------------\n\n### ExtensionStrings\n\n```c#\nconst string ExtensionStrings =\n \"XR_ANDROID_trackables \" +\n \"XR_ANDROID_device_anchor_persistence\"\n``` \nThe OpenXR Extension string.\n\nUsed to check if this extensions is available or enabled. To enable runtime confiugration, always enabling persistence extension when it's available. \n\n### FeatureId\n\n```c#\nconst string FeatureId = \"com.google.xr.extensions.anchor\"\n``` \nThe feature ID string. \n\n### PersistentExtensionString\n\n```c#\nconst string PersistentExtensionString = \"XR_ANDROID_device_anchor_persistence\"\n``` \nThe OpenXR extensions for persistence feature.\n\nUsed to check if this extensions is available or enabled. \n\n### UiName\n\n```c#\nconst string UiName = \"Android XR (Extensions): Anchor\"\n``` \nThe UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.\n\nPublic static attributes\n------------------------\n\n### IsExtensionEnabled\n\n```c#\nbool IsExtensionEnabled =\u003e _extensionEnabled\n``` \nGets if the required OpenXR extension is enabled.\n\nWhen OpenXR runtime is waiting, it returns `null`. Otherwise, it indicates whether the XR_ANDROID_trackables extension is available on current device. \n\n### RequiredPermission\n\n```c#\nreadonly AndroidXRPermission RequiredPermission =\n AndroidXRPermission.SceneUnderstandingCoarse\n``` \nRuntime permission required to enable scene understanding.\n\nProperties\n----------\n\n### UsePersistence\n\n```c#\nbool UsePersistence\n``` \nGets or sets a value indicating whether to use persistence at runtime."]]