Struct android_app* app.window

My graphics framework uses the value of (android_app) app.window and app.activity. The meta quest seems to leave app.window set to NULL. Does OpenXR offer something that can be used in place of app.window?

android_app is entirely an application-side structure, associated with the “native app glue” library included in the NDK in source form: android_app Struct Reference  |  Android Developers

OpenXR on Android does definitely need an Activity object. OpenXR is subordinate to Android and its lifecycle, so just regular android should provide you with the activity in the usual way before you start making OpenXR calls.

Looks like app.window is an ANativeWindow, the native version of android.view.Surface. Native Window  |  Android NDK  |  Android Developers An OpenXR app is intended to do all of its rendering through OpenXR, or at least all of its immersive rendering. There is no clear meaning of what a given ANativeWindow would mean in the context of OpenXR: for plug in viewers, they might have a 2D ANativeWindow on the phone while showing immersive content on the headset, while all in one devices may not even create an android.view.Surface for immersive apps. (Neither of these is hypothetical, btw, I am aware of actual systems fitting those two cases.)

There is a surface swapchain extension that allows you to submit a Surface as a composition layer. If your engine/framework is using this for some UI or similar, maybe that would be an option? otherwise your framework may need to be adapted to work properly in an immersive environment where you do not have direct access to the underlying graphics surface (but also do not have to worry about creating it). You don’t render to that ANativeWindow, you render to a texture (basically, offscreen) associated with XrSwapchain, and submit that to OpenXR to display things.