Siddhpura Amit
Siddhpura Amit

Reputation: 15078

find distance between two geo point with direction android

i am able to find distance between two geolocation by two Location objects

here is below

       mLoc.distanceTo(mLocTarget)

mLoc is current user Location and mLocTarget is target location of android

now i want to find direction also means like

16m. West or 16m. North is it possible?

Upvotes: 5

Views: 1081

Answers (2)

jeet
jeet

Reputation: 29199

You can find Direction between two locations by Bearing.

public float bearingTo (Location dest)

Upvotes: 5

PeterJ
PeterJ

Reputation: 3795

getBearing() returns the instantaneous bearing, but for between to points use:

public float bearingTo (Location dest)

Upvotes: 6

Related Questions