gpt4 book ai didi

android - 为什么 location.getSpeed() 在 android 中使用 NETWORK_PROVIDER 时总是返回 0?

转载 作者:太空宇宙 更新时间:2023-11-03 12:34:07 33 4
gpt4 key购买 nike

在 GPS_PROVIDER 中使用 location.getSpeed() 工作正常并且它获得当前速度。但在 NETWORK_PROVIDER 中它总是显示速度 0。我只在设备而不是模拟器中进行测试。

最佳答案

Gps 提供商提供 5-15 米内的位置精度,因此当您调用方法 location.getSpeed() 时,它会提供正确的位置,而网络提供商不会提供准确的位置,它会提供 100 米以内的位置,因此当您调用 location.getSpeed 时() 那么它不知道你在 100 米之间的准确位置。

关于android - 为什么 location.getSpeed() 在 android 中使用 NETWORK_PROVIDER 时总是返回 0?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24928299/

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