title: How do I get walking speed using GPS?
body: <p>I am trying to track my accurate walking speed. I am using the <code>getSpeed()</code> method of the <code>LocationManager</code> class. The problem is, the speed is not accurate, also answered by <strong>AlexWien</strong> <a href="https://stackoverflow.com/questions/28044261/android-gps-get-driving-car-speed">here</a> . Wein claims "The higher the speed, the more acurate it is. Under 10km/h it does not work well." So what would be the most precise way to do this if getSpeed is not built for precision? I did not stumble upon anything else yet.</p>
  
  <pre><code>// Acquire a reference to the system Location Manager
      LocationManager locationManager = (LocationManager) this
              .getSystemService(Context.LOCATION_SERVICE);
  
      // Define a listener that responds to location updates
      LocationListener locationListener = new LocationListener() {
          public void onLocationChanged(Location location) {
              location.getLatitude();
              Toast.makeText(context, "Current speed:" + location.getSpeed(),
                      Toast.LENGTH_SHORT).show();
  
          }
  
          public void onStatusChanged(String provider, int status,
                  Bundle extras) {
          }
  
          public void onProviderEnabled(String provider) {
          }
  
          public void onProviderDisabled(String provider) {
          }
      };
      locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
              0, locationListener);
  </code></pre>
  
  <p>PS:: I understand that both Location and Fine Location permissions are required in this case.</p>