0

我正在开发一个应用程序,我想在其中使用 CLLocationManager 类获取位置详细信息。但是如果我调用 startlocationupdating 方法,那么 GPS 就会启动。

我不想使用 GPS 获取位置详细信息。我想关闭 GPS 并使用 WiFi 或蜂窝塔获取位置详细信息。我怎么能做到这一点?

4

2 回答 2

0

Set desiredAcuracy to kCLLocationAccuracyKilometer; You can proove that you dont have GPS by:

  • you never get course (degrees) (may also called heading, correct me)
  • you never get speed (m/s)

from your CLLLocation object, especially when moving
Further if you

  • dont get altitude,

its not GPS, too (also works when vehicle is stand still

the other possibility is to avoid GPS is to enable location service with "significantLocantionChange" mode. But for this i have no personal experience.

于 2013-02-05T11:56:39.873 回答
0

从 CLLocationManager 文档页面(https://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

对于您使用的服务,您应该准确配置与该服务关联的任何属性。位置管理器对象通过在不需要硬件时关闭硬件来积极管理电源。例如,将位置事件的所需精度设置为一公里,使位置管理器可以灵活地关闭 GPS 硬件并仅依赖 WiFi 或蜂窝无线电。关闭 GPS 硬件可以显着节省电力。

基本上wifi位置会禁用GPS,从而降低您的准确度

于 2013-02-05T08:50:39.417 回答