Apple’s iPhone OS 4 developer preview event has two highlights — Multitasking and iAd. Let’s look at the details of the Mutitasking feature.
Apple has narrowed down the needs of multi-tasking to 7 core API calls. These will be available to developers to integrate with their existing apps to make them multitasking aware. All the user has to do while running one app is launch another app after pressing the home button, then press the home button twice to bring up a tray with the currently running apps. The user will not needed/allowed to quit apps. The intelligent app switching decides which app gets priority.
All of this is done without draining the battery life and slowing down foreground apps. These are problems that plague Android. No doubt they will implement this in their next update. Here are the 7 background API’s that make multitasking possible. The whole apps don’t run in the background, only the API features do. The app state is frozen on switch out.
Audio
Used by apps like Pandora, on which it was demoed, background audio allows the app to playback/stream audio and use the lock screens iPod controls to control audio. Now you can play what you want in the background while surfing, chatting, etc.
VoIP
Skype uses this, of course, and was used to demo it. Now when you switch out from Skype, you still stay online and can receive calls. Whenever you get call in the background, you are notified of it and while in call and on another app, the title bar flashes red to remind you.
Background Location
Now you can have apps like TomTom guide you no matter what app you are on. Using this API, developers can make their apps call for the user’s geo-location data. But since having a GPS running all the time when not plugged in can drain the battery very fast, the service uses cell phone towers when possible. A small notification icon on the status bar indicates that an app is using your location data.
Push Notifications
This has been there for a while now and is immensely successful. That’s mainly because the device needed some kind of a notification service! This is a server side feature that requires a push notification server to be set up. According to Apple, they have served over 10 billion push notifications since it’s inception. Well, with 85 million users on the platform — no kidding!
Local Notifications
These work just like the Push Notifications but on the device itself. This feature does not need a server to be set up. This can be used for alarms from the background like a TV show coming up in 5 minutes.
Task Completion
This API can be used for apps running in the background that are getting something done. This is especially helpful for the times when you have to upload something from the iPhone and you have to wait till the task is finished before you can do something else with your phone. Once the task is completed, the user can be notified of course.
Fast App Switching
This is the API that makes the magic happen. This enables the developers to define the app state when the user switches out. That way, they can define exactly how the app will behave once the user returns. It is like describing the vital parts of your app so that they are preserved in their current state once the user switches. This frozen state is then reinstated once the user switches back.





No comments yet.