Maths behind the Android orientation calculation algorithm

by DD » Sun, 28 Mar 2010 13:30:33 GMT

Sponsored Links

I know Android calculates the orientation of the phone by fusing the
acceleration and magnetic field readings. The related APIs are
getRotationMatrix() and getOrientation(). I looked into the source
code of these two APIs 

But I couldn't really figure out where exactly the implementation came
from... Could anybody tell me where I can find the theory of this
algorithm and detailed mathematical background of it? I'm currently
implementing exactly the same algorithm offline in MATLAB, and trying
to write some mathematical analysis about it.

Thank you very much!


Other Threads

1. Upgrade to Android 2.2 phones

Hi all,

I am still new to Android and planning to create an app on Android. I
have heard that Android 2.2 OS is out already, but I have not seen any
phones in the market that support Android 2.2 yet. I currently live in
Australia, and most Android phones here is 2.1

My question is, would it be possible to upgrade to Android 2.2 from an
Android 2.1 phones? I haven't got an Android phone yet and plan to get
it later.

Thank you so much for your assistance.

Kind regards,



2. Java Midlet


I have my own java midlets which I want to try to run in Android phone
itself. I have tried using Midlet runner available in Market (by
netmite) but it only allows me to browse through available java
midlets and install from a website. I want a runner which i want to
use to test my own midlets. Or is there any other method other than
using Midlet runner?

Thanks and Regards,


3. Content provider / ListView - Close the database but leave the cursor open?

4. Should I put "Please visit our sponsors" above my ads ?

5. Problem in Contacts restoring

6. Transparent textures in OpenGL ES.. How?

7. Accessories HTC Desire, Google Nexus One, Motorola Milestone - Motorola Droid, Samsung Galaxy Spica, Universal USB Car Charger.