Using the GPS to capture speed
android, android-4.2-jelly-bean, gps, java
Solution
You will have to use LocationManager which is used to get user location through GPS, the GPS data that returns includes the speed. You will have to use the `onLocationChanged(Location location)` function of the LocationListener.
To get the speed you will need to do this:
int speed = location.getSpeed();
which is in m/s, if you need to convert it to km/h use this:
int speed=(int) ((location.getSpeed()*3600)/1000);
if you need to convert it to mph use this:
int speed=(int) (location.getSpeed()*2.2369);
Problem
Possible Duplicate: Detect a speed in android I am getting into Android development and I would like to start messing around with the GPS and capturing speeds. Is there a way I can easily capture the speed using the gps and display that speed on the screen? Any simple frameworks or built in functions I could use?