0


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

user3921255
  • 41
  • 1
  • 2
  • 5

1 Answers1

0

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);
Ridcully
  • 23,362
  • 7
  • 71
  • 86