什么是位置提供商“被动”?在搭载 Android 2.2 的 HTC Desire 上看到

发布于 2024-10-09 02:27:32 字数 337 浏览 0 评论 0原文

在进入基于位置的模式之前,我通过调用

List<String> android.location.LocationManager.getProviders(boolean enabledOnly) //enabledOnly = true

并检查结果列表的大小来检查是否存在任何位置提供程序。

现在我在配备 Android 2.2 的 HTC Desire 上测试了我的应用程序。系统设置不允许任何位置跟踪(GPS 和移动设备已关闭)。

但是,返回的列表有 1 个条目,其值为“passive”。它是什么?我可以使用它吗?该提供商似乎很慢/不工作。

Before I go into location based mode I check for existence of any location providers by calling

List<String> android.location.LocationManager.getProviders(boolean enabledOnly) //enabledOnly = true

and checking the size of the resulting list.

Now I tested my App on a HTC Desire with Android 2.2. The system settings don't allow any location tracking (GPS and mobile is turned off).

However, the list get returned has 1 entry, whose value is "passive". What is it? Can I work with it? The provider seems to be slow / not working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白色秋天 2024-10-16 02:27:32

来自 Android API 参考

一种特殊的位置提供程序,用于接收位置而无需实际启动位置修复。当其他应用程序或服务请求位置更新时,该提供程序可用于被动接收位置更新,而无需您自己实际请求位置。该提供商将返回其他提供商生成的位置。

因此,如果没有其他可用的位置提供商,它不太可能对您有任何好处。

From the Android API reference:

A special location provider for receiving locations without actually initiating a location fix. This provider can be used to passively receive location updates when other applications or services request them without actually requesting the locations yourself. This provider will return locations generated by other providers.

So no, it's not likely to do you any good if there are no other location providers available.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文