can we detect a speed of moving using locationmanager class
posted 5 years ago
I have small application which shows current location on the map.I need to add the moving speed to the that application.
1)Is there a way to get speed from locationmanager class ?
2)If not can anyone suggest me a way ?
If you can determine the location at time X and the location at time Y, and if you can store that information, and if you can compute the distance between two locations, then yes, you can compute your speed over that interval. The definition of speed is
Speed = Distance / Time
You'll want to avoid choosing a short interval for "Time" because that will magnify the errors in "Distance" which come from inaccurate estimates of the location.