Android - How to get magnetic North?

Soldato
Joined
9 Jun 2006
Posts
2,642
Hi all,

I've spent a while researching how to get magnetic north with an Android app I'm trying to write. I'm finding it surprisingly difficult to find a good example, as a lot of them use the orientation sensor which according to the documentation is deprecated.

Can anyone give any tips as to what sensors I need and what calculations I need to do to actually get magnetic north?

Thanks
 
You could use GPS. (0,0) would be the North Pole.

If you're wanting to be able to calculate which direction the phone is pointing, check out this post on StackOverflow.
 
Last edited:
Back
Top Bottom