Finding a Compass Heading on Android

Nightlife picture Nightlife · Feb 21, 2016 · Viewed 7k times · Source

I want to display an arrow at my location on that displays my direction relative to a destination location. Similar to this stackoverflow question: Calculate compass bearing / heading to location in Android I want to find the heading or the measure east clockwise from magnetic north. I have read many articles and realize I will have to use the magnetometer and accelerometer, but I am unsure how to combine the two to find my heading. I have access to the coordinates to my current location and my destination location.

Answer

Nightlife picture Nightlife · Feb 21, 2016

After doing some more research I found this link https://www.codeofaninja.com/2013/08/android-compass-code-example.html I implemented the code and it successfully created the compass head for my android phone.