Good Things About Core Location

I posted last week about some of the new features in the much-maligned Apple Maps that will benefit map-related apps (once Apple get their data fixed). This week I want to turn my attention to Core Location, because this also has some great new features in iOS 6.

Location Accuracy

The Core Location framework has always provided location readings based on three different positioning mechanisms; GPS, wireless triangulation and cellular triangulation. Switching between the different mechanisms is transparent to us as developers, apart from the hints we give in terms of the accuracy we need for our application. More accuracy and more frequent updates means more battery drain of course.

With iOS 6, the choice of mechanism is still transparent to us but Apple have combined the readings from each piece of location-capable hardware and use cellular and wireless signals to enhance the accuracy of GPS positioning. In addition Core Location in iOS 6 also brings map data into the equation to produce a very high level of accuracy in urban areas.

It’s a difficult one to evaluate without long-term testing but I had a wander around my home town this week, taking my iPhone and a little app I wrote that allows you to mark a position and return to it. Running this app on iOS 5, it would return me within a circle of about 6m from my front door. With iOS 6, it was noticeably more accurate, which should make turn by turn direction apps more consistent and reliable.

WiFi Tiling

Devices using WiFi for location updates, e.g. iPod touch or WiFi-only iPad, need connectivity to an access point to download locations for WiFi access points before they become useful as triangulation markers. In iOS 6, Apple have improved the way this data is downloaded and stored to make use of intelligent tiles that can cache the locations of access points over a much wider area than before.

For end-users, this means that a session checking email in a coffee shop or an the hotel can store a much wider area of WiFi access points in its cache. So you can wander around much more freely getting location updates, long after you lost connectivity through an access point. This means that photos can be geotagged and regions can be monitored, even with devices that don’t have GPS.

Battery Life

Apps delivering location updates in the background can be a huge drain on battery life. For example, when using the Reminders app to deliver a reminder when arriving home, there’s no point continuing to have location updates when your phone is sitting on the desk while you are in a meeting. Or if you are on an underground transport network and have no signal.

iOS 6 introduces a new monitoring feature within Core Location that is intelligent enough to detect when location updates associated with an application activity are unnecessary. When such situations are detected, iOS 6 automatically suspends location updates to save power. The pause behaviour is enabled automatically on iOS 6 for existing location-aware applications and different activity types can be configured for the application as hints to Core Location when suspension is appropriate.

With location updates one of the most power-sapping tasks on an iOS device, this should be a great feature to make location-aware apps more battery friendly.

You can learn more about writing location aware applications on Learning Tree’s Building iPhone® and iPad® Applications: Extended Features course.

Richard Senior

Type to search blog.learningtree.com

Do you mean "" ?

Sorry, no results were found for your query.

Please check your spelling and try your search again.