【问题标题】:Is there a way to put CLLocationManager into "idle" but not "stopped"?有没有办法让 CLLocationManager 进入“空闲”而不是“停止”?
【发布时间】:2011-05-04 10:45:30
【问题描述】:

我正在做一个跟踪应用,它可以在后台从 CLLocationManager 获取位置,这带来了在用户不知情的情况下吃电池的危险,所以我想尽可能节省电池。

当有足够的卫星提供 GPS 位置时,我希望应用程序“主动”跟踪(使用locationManager.distanceFilter = 10;),但当用户在室内(无法从卫星获取 GPS 位置)或不移动时“空闲” (即使有卫星覆盖)。

问题是如何做“空闲”。 [locationManager stopUpdatingLocation]; 将完全停止检查位置更新,然后不知道何时切换到“主动”跟踪。

请问有人给点提示吗?谢谢。

【问题讨论】:

  • Java、Objective-C?这是什么鬼?
  • 我已删除 objC 标签并添加 iphone one...

标签: iphone gps location cllocationmanager battery


【解决方案1】:

你看过:CLLocationManager

- (void)startMonitoringSignificantLocationChanges

或者可能

- (void)startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy

【讨论】:

    猜你喜欢
    • 2011-04-13
    • 1970-01-01
    • 2021-03-17
    • 1970-01-01
    • 2019-08-21
    • 1970-01-01
    • 1970-01-01
    • 2013-12-25
    • 1970-01-01
    相关资源
    最近更新 更多