gpt4 book ai didi

安卓 GPS 速度

转载 作者:太空狗 更新时间:2023-10-29 14:23:01 25 4
gpt4 key购买 nike

我有一个关于 android.location.Location.getSpeed() 的问题。我已经实现了我的 LocationListener 并指定其提供者使用 GPS。这样 getSpeed() 总是 0.0。我读过这个,没问题。现在,当我设置 Criteria 并指定

criteria.setSpeedRequired( true );

再往下

String bestProvider = mLocationManager.getBestProvider( criteria, true );
mLocationManager.requestLocationUpdates( bestProvider, mIntervaltime, mDistance, locationListener );

bestProvider 又是 GPS 提供者,但我收到速度值。为什么? LocationManager.GPS_PROVIDER 和 mLocationManager.getBestProvider( criteria, true ) 之间有什么区别?当双方通过检查表明他们使用 GPS 提供商时:

Log.i( TAG, "  Provider: " + location.getProvider() );

最佳答案

也许我误解了这个问题,但你必须移动 GPS 才能报告大于零的速度值。

关于安卓 GPS 速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15049656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com