• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can we detect a speed of moving using locationmanager class

 
sam liya
Ranch Hand
Posts: 1243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic