title: What is the best way to calculate distance travelled over a period of time?
body: <p>I am trying to calculate the distance elapsed over a period of time in an app for the Android platform.<br>
  What is the best way to do this?<br>
  At the moment, I am implementing LocationListener interface.<br>
  I am overriding the method onLocationChanged</p>
  
  <p>I am currently doing something like this:</p>
  
  <pre><code>public void onLocationChanged(Location location) {
          Log.d("onLocationChanged", "onLocationChanged");
  
  
          old_location.set(new_location);
          new_location.set(location);
          totalDistanceElapsed += new_location.distanceTo(old_location);
  </code></pre>
  
  <p>}<br>
  So I am adding the distance from the old location point to the new location point ever time "onLocationChanged" is called.
  Is this correct?
  Do I need to do anything else?
  Will this be accurate? If not, how can I make it more accurate? thanks</p>