Calculating user moving speed in android

こ雲淡風輕ζ 提交于 2019-11-29 10:42:43

问题


I need to calculate Speed with which the user is moving. So we need two things to calculate speed which are GPS and Accelerometer.

But both have their limitations.

1)GPS is not available all the time.While I getting the current location of user always I am getting from Network provider only and not from GPS.

2)Accelerometer is not accurate.

So which approach should I go with?


回答1:


An implementation, based on the GPS, is available at this link




回答2:


The most accurate results can be obtained by using both of them, through sensor fusion. See my previous answer to question Using accelerometer to calculate speeds or to another question GPS V.S. accelerometer to calculate distance.

As for the accuracy of the accelerometer, see Get velocity from 3DVector using accelerometer sensor.

If you want to track the user indoor, see what you can actually do at question Android accelerometer accuracy (Inertial navigation).




回答3:


You can call .getSpeed() on the locationprovider



来源:https://stackoverflow.com/questions/11643727/calculating-user-moving-speed-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!