4

I want to programmatically set screen orientation using Native only. I know I can set/lock orientation in AndroidManifest.xml file with android:screenOrientation="landscape", but this means I have to rebuild each time I want different orientation for specific apps.

What I would prefer is, read a setting from a file like AndroidManifest and set orientation before EGL and OpenGL are initilized, so I dont need to rebuild the APK. If one wants other orientation, just edit the file and run the app.

I would also like to avoid any Java code if possible as my app is written in C++ only.

I looked at NDK source and found AConfiguration_setOrientation function, but it does not work.

Thanks

Slide
  • 91
  • 1
  • 5

0 Answers0