The easiest way is to get the speed of the device from GPS, more precisely, the time taken to move between 2 points. Fortunately, this has already been done for you with the Location: Location.getSpeed() class, which returns a float at a speed in m / s.
Read more about Android Developer Link for more information.
James goodwin
source share