My application works fine on my old HTC One M7 in terms of distance calculation. However, on my wife HTC One M8 and on my new Sony Xperia Z3, the distance that he calculates is disabled. This tells me that I went further than it actually is. I noticed this more when I went or ran. If I ski, it seems more accurate. I assume that speed has something to do with it (if I am faster, the calculations are more accurate).
I call the update method of my total distance every time I change location, which does this:
float[] distanceResults = new float[3];
double distanceResult = 0;
try
{
Location.distanceBetween(location.getLatitude(), location.getLongitude(), previousLocation.getLatitude(), previousLocation.getLongitude(), distanceResults);
distanceResult = distanceResults[0];
}
catch(IllegalArgumentException e)
{
distanceResult = 0;
}
totalDistanceValue += distanceResult;
, . 20 , ... .
- , , , ?