If someone is still interested in a pure native solution to get the initial/default screen orientation, please use the code below.
For more information about the associated JAVA method:
https://developer.android.com/reference/android/view/Display.html#getRotation()
int get_inital_screen_orientation(struct android_app * app){
JavaVM *lJavaVM = app->activity->vm;
JNIEnv *lJNIEnv = app->activity->env;
jobject n_instance = app->activity->clazz;
lJavaVM->AttachCurrentThread(&lJNIEnv, 0);
int rotation = -1;
if (lJNIEnv) {
jclass c_clazz = lJNIEnv->GetObjectClass(n_instance);
jclass c_windowManager = lJNIEnv->FindClass("android/view/WindowManager");
jclass c_display = lJNIEnv->FindClass("android/view/Display");
jmethodID getWindowManager = lJNIEnv->GetMethodID(c_clazz, "getWindowManager", "()Landroid/view/WindowManager;");
jmethodID getDefaultDisplay = lJNIEnv->GetMethodID(c_windowManager,"getDefaultDisplay","()Landroid/view/Display;");
jmethodID getRotation = lJNIEnv->GetMethodID(c_display, "getRotation", "()I");
jobject windowManager = lJNIEnv->CallObjectMethod(n_instance, getWindowManager);
jobject display = lJNIEnv->CallObjectMethod(windowManager, getDefaultDisplay);
rotation = lJNIEnv->CallIntMethod(display, getRotation);
lJavaVM->DetachCurrentThread();
}
return rotation;
}