View Single Post
Old 11-06-12 | 08:26 PM
  #10  
sstorkel
Senior Member
 
Joined: Apr 2008
Posts: 5,428
Likes: 2

Bikes: Cervelo RS, Specialized Stumpjumper FSR Pro, Schwinn Typhoon, Nashbar touring, custom steel MTB

Originally Posted by raybo
You and I have talked about this before. Why can't you add a feature that wakes up every so often, say every 10 minutes, does a GPS check, stores it for download later, and then goes back to sleep. If the every 10 minutes is too often, then the user can make it longer.
Apple's APIs pretty much make this impossible... They don't want to allow random code to run periodically in the background for fear that some misbehaving app will drain the battery and the user won't be able to figure out which one it is. In addition, this method would require firing up the GPS chip in full-power mode to obtain a position fix. Not as power-intensive as running the chip continuously, but it does use more juice than alternate methods.

chrisch: you may want to consider using the new "geofencing" APIs on CLLocationManager. Specifically: startMonitoringForRegion:desiredAccuracy: or startMonitoringForRegion:. The idea would be to setup a geofence around the user's current location with a radius of, say, 5 miles. When the user goes outside that radius your app delegate gets a notification (via locationManager:didExitRegion:) and you could then record their new position and setup a new geofence around their present position.

Using this technique would allow you to "drop pins" at regular intervals along their route. You could make the size of the geofence configurable: on a local ride you might want pins every mile or two while on a cross-country trip you could get by with 10- or 20-mile intervals.
sstorkel is offline  
Reply