如何在Android通过GPS跟踪距离是多少?距离、如何在、Android、GPS

2023-09-06 23:50:30 作者:-为了你我会坚强

我怎么会去追踪用户移动的距离?我并不关心存储航点,尽管这可能是必要计算反正距离。 到目前为止,我创建的 LocationManager 的和regsitering一个的 onLocationChanged 的侦听器,然后计算两个点之间的原始距离在侦听火灾。

How would I go about tracking the distance a user travels? I don't necessarily care about storing waypoints, although that may be necessary to calculate distance anyway. So far, I am creating a LocationManager and regsitering an onLocationChanged listener, and then calculating the raw distance between two points when the listener fires.

这里的问题是,如果我离开应用程序坐不住了桌子上的10,15分钟后,它会说我已经走过0.5英里。我应该如何去检查的准确性和确定它指向使用?

The problem here is that if I leave the app sit still on a desk for 10, 15 minutes, it will say I have traveled .5 miles. How should I go about checking for accuracy and determining which points to use?

,或者甚至更好? - 有一个SDK或.jar我可以只包括在我的项目,并调用它们的功能,使这件事更容易

Or, even better - is there an SDK or .jar I can just include in my project and call their functions to make this whole thing easier?

感谢您的时间。

推荐答案

我不是一个Android程序员,但已经实现了这个功能,我在自己的嵌入式处理器,比运行Andriod的东西远不如处理能力。

I am not an Android programmer but have implemented this functionality in my own embedded processor with far less processing capability than anything that runs Andriod.

这是毫无作为由GPS立志做一个坐标的精度。如果你的天空完美的知名度固定的GPS接收器,并绘制其报告的位置随着时间的推移,你会看到它四处流浪的真实位置,把一些米任意方向。如果您积攒旅行,在非常小的步的距离,周围的真实位置,你将最终获得的行驶距离显然带你到地球与月球之间。

This is nothing to do with the accuracy of a fix as determined by the GPS. If you have a stationary GPS receiver with "perfect" visibility of the sky and plot its reported position over time then you will see it wander around the true location, moving some metres an any direction. If you accumulate the distance travelled, in very small steps, around the true position you will end up with the distance travelled apparently taking you to the moon and back.

您需要设置移动阈值​​大于你的GPS定位的定位精度,然后才在距离增加,当你确信你已经从上,你在最后一个乐章一步加的地步移动旅行

You need to set a movement threshold that is greater than the position accuracy of your GPS fix, and then only add in the distance travelled when you are sure that you have moved from the point at which you added in the last movement step.