My Android game uses OpenGL and Android NDK. I am currently passing the required dpi values as parameters, creating my own JNI call from my Activity / GLSurfaceView.
I am currently using:
// request an instance of DisplayMetrics, say 'dm' from android. float densityFactor = dm.density; // pass this as a parameter using JNI call myCustomNativeMethod(densityFactor);
I'm just wondering if it's possible to access Android environment settings without using JNI to get them (options). Maybe import some low-level NDK header files (.h) that will help me communicate directly with the user interface system or something like that?
I mean:
#import <android_displayparams.h> ... float densityfactor = getDisplayParamDensity(); // <- Is this possible?
Note. This is a question of curiosity, and I know that such a mechanism may not be very good practice.
source share