Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can we detect a speed of moving using locationmanager class  RSS feed

 
Ranch Hand
Posts: 1280
  • 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 ?
 
Sheriff
Posts: 23451
46
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
Boost this thread!