I need to calculate Speed with which the user is moving. So we need two things to calculate speed which are GPS and Accelerometer.
GPS
Accelerometer
You can call .getSpeed() on the locationprovider