Getting Speed using Google Play Location API

£可爱£侵袭症+ 提交于 2019-12-04 10:56:42

The only sensor that delivers speed is GPS.
Wlan and GSm cell Tower locatining cannot deliver speed.

If you need speed, you have to make sure that GPS is used exlusivley as Location Provider. You cannot use NetworkProvider for that task.

If speed is an important requirement, which has higher priority than battery consumption you have to stay with GPS Provider only. You have to avoid the fused location provider.

Its technically not possible to have speed without GPS.

I also encountered this problem when I was using Google Play Location API, I hope this can help.

It returns 0 because your device cannot get a lock on the GPS, or cannot connect to the GPS.

I tried to get the speed using an older lenovo device and it returns 0 because it cannot lock on a gps.

I tried using a samsung galaxy nexus and it returned my speed(has a better GPS sensor).

The GPS sensor in your phone might not be good or you are in an area that has a weak GPS signal such as inside a house or building.

Even if you use the locationManager to get the speed if you are not connected to the gps, your getSpeed will still return 0.

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