i want to detect screen rotation via native.
for a example, when touch event occured, we can detect via /dev/input/event* event device
is this possible ?
i mean, without using java. just use native method.
WindowManager wm = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
Display disp = wm.getDefaultDisplay();
int rotation = disp.getRotation(); // Android 2.2
Log.i( "Rotation", "rotation : " + rotation );
switch ( rotation )
{
case Surface.ROTATION_0:
Log.i( "Roation", "Portrait : 0" );
break;
case Surface.ROTATION_90:
Log.i( "Roation", "Landscape : 90" );
break;
case Surface.ROTATION_180:
Log.i( "Roation", "Portrait : 180" );
break;
case Surface.ROTATION_270:
Log.i( "Roation", "Landscape : 270" );
break;
}