I am developing an android application which is very similar to Uber, OLA etc.
I have google maps to help the driver to navigate. Total distance is calculated from point A to B and a amount is given based on the distance travelled. The trial worked fine with just a minor 0.2 km error, which is fine!
The problem I am facing is drifting GPS and getting the speed. Drifting GPS adds unnecessary values to the distance and hence it keeps increasing. I had an idea of using :
location.getSpeed();
from google maps API to the get the speed so that I can limit distance calculation to only when the speed is greater than 0. But the speed is always zero even if I am travelling on a vehicle, which is weird cause in reality there is actually a speed but the google maps gives me a zero speed.
Can anyone help me out in getting the speed?