Are iOS 4 background API really the best solution to multitasking?
Multitasking was widely rumored to be coming to the iPhone with iOS 4, but instead of a traditional "leave full apps running in the background" approach, Apple instead chose to implement a more restricted but, they felt, better performing and power friendly solution involving 7 specific background API (application programming interfaces.) Is that, however, the best solution to the multitasking challenge as Apple claims? I spoke to several developers during WWDC 2010 and asked them that question.
First, we'll review what Apple is doing in iOS 4, then we'll see if developers think it works as well in reality as as Apple says it does on stage.
How does Apple say iOS 4 multitasking works?
In addition to the existing push notification service from Apple's servers, which provide sound, badges, and alert popups for everything from IM to game challenges, iOS 4 adds local notifications so something like an alarm-clock app could register an alert that would sit in the background, on-device until the proper time, then activate. That takes the online server out of the equation which is good for tasks that don't need additional data from the cloud, and so don't have to activate the radios.
There's another API for task completion so that, for example, if you're uploading a picture to Twitter and leave the app, it can register a thread to keep uploading the picture in the background while you do something else. That means the entire app doesn't have to keep running, freeing up memory and lightening battery load, and even the thread will terminate when the upload is done.
Fast task switching deals with the perceptive speed that multitasking offers. With previous versions of iOS, if you left an App Store app it would shut down completely and if you went back -- regardless if it was a second or a week or later, it would usually restart not from where you left off but from essentially the beginning. (A few developers tried to add persistence on their own, so they'd save your place when you came back as best as previous OS versions allowed, but most didn't -- especially games which was aggravating when phone calls pulled you unexpectedly out of them). Likewise, if you closed one app and went to another, you could theoretically be stuck swiping back or forth between 11 home screen pages.
Saved state is now built into iOS 4 so all developers can more easily have their apps remember exactly where you were when you left and put you right back at that position when you return, Apple has also added a fast app switcher UI that, when you double tap the home button, lifts up to show you your apps "in the background" sorted in order of last usage. That means, if you're moving between a set of commonly used apps, they're most likely right next to each other and not screens and screens away. These two elements combine together to make launching apps perceptively much faster, even though the apps don't have to be running in the background consuming resources just for that convenience.
Lastly, but perhaps most famously, Apple is allowing apps to register three specific types of the threads for persistent backgrounding (they can just keep running until you close them). Again, this isn't the whole app running, just one thread from the app, so the idea is it won't slow down performance, use up memory, or drain battery to the same degree. These API are for streaming music, location, and VoIP (voice over IP).
This means you can listen to Pandora, Slacker, etc. while surfing the web. Navigon, TeleNav,TomTom, etc. can keep using the GPS and alert you to directions while you're on the phone, and to further save resources, non-critical location apps like FourSquare, Gowalla, Loopt, etc. can be alerted when you change cell towers. Fring, Skype, Line2, etc. can answer calls and receive messages when you're not in the app, making the. More equal telephony citizens.
How do developers think iOS multitasking really works?
Of the developers I spoke to during WWDC -- and I certainly didn't speak to them all -- they were remarkably pleased with how iOS multitasking was working out in practice. For those who made large, resource intesive apps, they actually preferred Apple solution since they didn't want to be blamed for performance hits on other apps while they were in the background (especially performance hits for other intensive apps like games). So far, they were also excited by the relatively low impact on battery life compared to traditional, full-on app backgrounding.
In terms of implementation, the devs I spoke with were really happy about how quickly they could implement the background APIs in their apps -- really quickly, much faster than they thought.
(if you're a developer with a different opinion, send it our way so we can get as well-rounded a sampling as possible).
How will users think iOS 4 multitasking works for them?
Like with copy and paste, it's possible Apple really did take their time to get multitasking right. It's also possible that, like many other Apple solutions, it will be outstanding at what it does, but limited or non-functional for those who want to do more -- like have an SSH session stay open in the background, or have their Twitter, IM, or RSS timelines be ready and waiting, just like mail, when they open an app.
We've heard from Apple, we've heard from developers, and starting June 21 when iOS 4 goes live for end users, we'll here how it works for all of them in the real world.
That, of course, will be the true test.
Have something to say about this story? Share your comments below! Need help with something else? Submit your question!