Background task management under the upcoming Windows Phone 8.1

Published by at

One question we were keen to see answered with Windows Phone 8.1 (now out in preview form for developers and enthusiasts) was whether the update interval for 'background tasks', the bits of applications which run every so often in the background to do useful stuff like update live tiles, would change from the current 30 minutes in Windows Phone 8.0 to something more frequent. It does seem from our tests that the interval hasn't changed, but fear not for there's more to updating in the background in 8.1 than simple scheduling...

One thing I noted when reviewing Bitcoin Average under Windows Phone 8.0 (doesn't writing '8.0' seem old now? - wow, that was quick!) was that live tile updates (i.e. retrieving the latest value and updating the Start screen) happened roughly every 20 minutes. Which is very odd, since all the developer documentation for Windows Phone says that background tasks are only scheduled roughly every 30 minutes.

Bitcoin Average screenshotBitcoin Average screenshot

The discrepancy is caused by a 10 minute margin of error built into the OS's scheduling system. In other words, the operating system starts to think about scheduling a particular background task after 20 minutes but because of the low system priority and possibility of other things happening (e.g. the user actively using the phone, files downloading and so on), the OS can only guarantee that the background task will get a 'look in' at some point in the next 10 minutes, i.e. leaving a possible 30 minute refresh on a very busy smartphone.

Of course, this is simplifying things slightly, but it does explain why I was seeing 20 minute refreshes of the Bitcoin Average live tile. In fact, I was seeing gaps like 21 mins, 22 mins, 21 mins, 23 mins, 20 mins, and so on. So the OS was getting round to that particular background task as soon as it could after the original 20 minute delay was over.

Under Windows Phone 8.1, I ran this, and other, applications in the same configuration and got the same results, i.e. just over 20 minutes between updates. The documentation on Microsoft's site does seem to confirm that the interval hasn't changed, though two very important things have:

  • RAM and processor time limits have been lifted significantly (see here for gory details), especially on devices with higher specification - in other words, applications can do more when their background tasks do get executed.
  • there's a whole new schema of triggers that can cause background tasks to be executed without having to wait for the next scheduled interval. These triggers get registered when an application developer codes and compiles for them and for Windows Phone 8.1. Once such an application (version) is installed and run, all sorts of events can trigger a background task (and a live tile) to update immediately. Examples of triggers include the user moving into a particular location, or coming into an area with Wi-fi, or a specific time occurring, or - more significantly - receiving an appropriate push notification. For a service-focussed application, the latter is an excellent way to achieve 'instant' live tile updates, for example.

In other words, background tasks are well behaved as before, but can also leap into action when really needed and with greater capability. Or at least they will once more applications have been coded to work optimally with Windows Phone 8.1 and once the OS update itself makes its way out into the mainstream via over the air updates and new devices.

Eagle eyed power users have already noticed one practical change in the Windows Phone UI with regards to managing background tasks. Under Windows Phone 8.0, you could swipe right from 'Settings - > system' and then right at the top of 'applications' is 'background tasks', where there's traditionally something of a 'whack a mole' job of making sure that the applications you do want to be able to schedule background tasks are 'allowed' and those that you don't are 'blocked'.

Screenshot, Windows Phone 8.1 background featureScreenshot, Windows Phone 8.1 background feature

8.0: sorted alphabetically, no real detail; (right) 8.1: sorted according to 'power consumption', tap through for more, etc.

This interface has been moved and adapted in Windows Phone 8.1, taking advantage of the way individual applications have their (relative) power consumption tracked in the Battery Saver application. You can get to this via Settings or from the main app list.

The bars shown are slightly misleading in that what really uses up your battery power on a smartphone is the hardware, of course - the display, the connectivity, the camera, the GPS transceiver, etc. But the bars give you a rough idea of which applications were in 'control' when all these factors were using up your precious milliamp-hours.

If an application is shown high in the power table and with 'Allowed' beneath it, then a tap on the entry takes you to a details pane, as shown below, letting you dig deeper into the power usage for that application when in the foreground and when in the background. And, if you feel it's necessary, you can toggle background permission here.

Screenshot, Windows Phone 8.1 background feature

It all adds up to being better informed and being more in control of what your Windows Phone 8.1 applications are up to. And the applications, in turn, can do more in the background, more flexibly. 

What this all adds up to in terms of impact on battery life remains to be seen, of course. My gut feel is that overall battery life won't change significantly, though this is still only day three of Windows Phone 8.1 in use out in the real world. Ask us again in a few weeks!