android - How to get compass direction -


i want show direction on screen phone facing. example:

   0    |- []    |_   south --- north 

in above diagram phone display "north". since user (the stick 0 head) holding out phone (the [] in diagram) pointing north.

i found this example. understand it's doing except seems calculate yaw, pitch, roll, , inclination. , how use them find way phone pointing?

also android documentation mentions x, y, , z axises don't see anywhere says how axises correspond phone? z going bottom of phone top?

this how axis (axiy?) like.

i couldn't find link cheat sheet use, looked sort of this.

in summary, want register listen sensor.type_orientation, incoming array of values get, value[0] , should show angle (from north believe).

some example *android.com


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -