finding speed using GPS
<p>In my application I am retriving speed of a device using getSpeed() method of Location class. It gives speed in meters/sec. To convert this value to km/hr I am multiplying this with 3.6. But I am getting wrong speed. ex. 580 when it is moving with speed of 40km/hr. This is my code:</p>

<pre><code>public void onLocationChanged(Location location)
{   
    float mps = location.getSpeed();
    float kmh = (float) (mps*3.6);
    speed = Float.toString(kmh); 
    Toast.makeText(context,"speed :"+speed,TOAST.LENGTH_LONG).show();
}
</code></pre>
