Android getOrientation()
I spend some time today trying to understand getOrientation() and found a few notes when I googled, but most of the notes left things fuzzier than needed. The author’s appear to know what they were talking about – but failed to express it with a good clarity… The documentation states: getOrientation (float[] R, float[] values) Computes the device's orientation based on the rotation matrix. Not exactly a rich description! When I attempted to write code, the expected results did not occur…. The core of the code is: SensorManager.getRotationMatrix( rotationMatrix , null , accelVals , magVals ); SensorManager.getOrientation( rotationMatrix , orientationVals ); textView1 .setText( " 0:" + orientationVals [0]+ " 1:" + orientationVals [1]+ " 2:" + orientationVals [2]); Where the values are supplied by (I’ve omitted the code for stabilizing the values) @Override public void onSensorCh...