Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compass guide to GPS destination

I want to rotate an ImageView with an arrow from the current user location to some previously saved GPS location. How do I do this?

Is the Initial Bearing got from the Location.distanceBetween method the right way to go on this? If so, how do I use it with the compass readings?

like image 268
DArkO Avatar asked Nov 15 '22 07:11

DArkO


1 Answers

You can use the bearingTo method in Location class, then retrieve the current bearing using the SensorManager.getOrientation method.

Finally, adding both results, draw the arrow.

Hope it helps.

like image 98
Mister Smith Avatar answered Nov 17 '22 05:11

Mister Smith