I am creating an android compass application.
However, I want to add a functionality where the compass will point to some co ordinate that I have specified.
How can I achieve this.
Thanks and Regards,
Rohit Savant
I am creating an android compass application.
However, I want to add a functionality where the compass will point to some co ordinate that I have specified.
How can I achieve this.
Thanks and Regards,
Rohit Savant
For what you want to achieve you will need 2 Locations, your own and that of the target. Then you can use the bearingTo()
method to determine the angle from you to the target:
Location me = ...
Location target = ...
float angle = me.bearingTo(target);