Use the Meta VR Gaze SDK for Android Views to call Horizon OS gaze APIs without writing your own operating-system version checks. The compatibility extensions call the platform API when it is available. On other Android devices, they do nothing, so you do not need platform checks around them.
The Meta VR Gaze SDK is unstable and available by request through the Meta Horizon developer support form. Select Technical Support in the form when requesting the SDK. It is compatible with Meta Horizon OS v207, but apps submitted to the Meta Horizon Store with the SDK bundled will be rejected in order to ensure compatibility with future OS versions. A stable version will be published in a future release before Meta VR Glasses launch.
The SDK requires Kotlin 2.1.0 or later.
Add the SDK
The SDK package includes gaze-view-0.4.0.aar. Copy the AAR into the app module’s libs/ directory.
These instructions assume that your project already includes the Meta VR OS JSDK as a compile-only dependency.
Add the local AAR in the app module’s build.gradle.kts:
Use setImportantForInteraction to control whether a View participates in gaze targeting. For an existing View named settingsView, set Android’s tooltipText, then use setTooltipVisibility to show it for gaze.
The compatibility helpers report whether the platform APIs are present. Use supportsImportantForInteraction() and supportsTooltipVisibility() when shared code needs to react to those capabilities.
Test the result
Verify targeting and tooltip behavior on a supported device. If a call has no effect, use the matching supports...() helper to check the underlying API.