What's location provider “passive”? Seen on HTC Desire with Android 2.2

末鹿安然 提交于 2019-12-22 05:43:26

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4519389/whats-location-provider-passive-seen-on-htc-desire-with-android-2-2

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