Apple has provided a sneak peek at a developer preview of iPhone OS 4.0, the next major version of its operating system for mobile devices.
Apple CEO Steve Jobs boasted over 1500 new application programming interfaces (APIs) for developers in iPhone 4.0, letting them access features like the iPhone’s calendar, photo library, video-camera data, and more. App creators can also take advantage of OS X features like Quick Look, in-app SMS, and more. Plus, there are over 2000 APIs for hardware-accelerated math functions.
In addition, iPhone 4.0 boasts more than 100 new user features, such as playlist creation, 5x digital zoom in the camera app, tap-to-focus for video, auto photo-geotagging, the addition of Places functionality, the ability to change the Home screen wallpaper, improved spell-checking, and support for Bluetooth keyboards. Many of the features added are already available on the iPad, which currently runs iPhone OS 3.2.
Instead of running down the entire extensive list, Jobs focused on seven "tentpole” features that will be part of iPhone 4.0.
Easily one of the most anticipated additions to the OS, multitasking will be a part of the iPhone 4.0 update. The feature is already offered on rival mobile platforms - most notably, Google’s Android OS - but Jobs believes Apple has done a better job implementing multitasking capabilities.
“We weren’t the first to this party, but we’re going to be the best, just like [with] copy-and-pate,” said Jobs, alluding to the feature introduced in last year’s iPhone 3.0 update.
In order to switch applications, users double-click the Home button which summons a dock-like strip showing all running applications; tap on an app to switch to it. If you’re playing a game, it will pause when you switch, and you’ll be able to resume right where you left off when you switch back.
By default, that dock shows you four running applications, but if you have more running at one time, you can swipe left to see the rest of them.
Apple contends that multitasking on most mobile devices can hamper performance of the app running in the foreground while draining battery life. “We’ve figured out how to do it and avoid those things,” Jobs said.
Specifically, Apple looked at existing iPhone applications in the App Store and tried to identify what services are needed in the background, according to senior vice president of iPhone software Scott Forstall. Apple then wrote its own code to implement those services, which it has made available to third-party developers as APIs. That way, the system is responsible for maintaining battery life and performance, rather than having each additional app try and figure it out.
Apple will provide background APIs in seven areas:
Audio: To demonstrate the audio API, Pandora founder Tim Westergren joined Apple’s presentation to show how the streaming app used Apple’s new technology, a change that took just a few hours to implement. Just as double-tapping the Home button when the iPhone is locked currently summons the iPod controls, that same action will bring up controls for Pandora if that app is active in the background. At this point, it’s unclear if the music playback controls will be available when the iPhone is unlocked, or if Apple just expects you to switch to the relevant app to adjust playback.
Voice over IP: Apple showed off the Skype app taking advantage of background processes. Users can be on Skype calls and do other tasks; in fact, users can even receive Skype calls while the iPhone is locked and Skype isn’t the foreground app. When users receive a Skype call, they are alerted via a pop-up notification with a custom sound, which allows them to answer the call. The iPhone also displays a red status bar to alert the user that they are still in Skype. Apple noted that the API applies to any communications app including messenger apps and Twitter clients.
Location services: You can continue to get directions from turn-by-turn GPS apps, even while performing other tasks such as listening to music in the iPod app, thanks to this API. Some apps use location information, but they don’t require GPS to be always-on; instead Apple uses mobile phone location information. When a user switches mobile phone towers, it can indicate to the service that location has changed. To satisfy privacy concerns, Apple will add an indicator in the menu bar, next to the battery icon, to let you know if an application has requested your location any time in the past 24 hours. And preferences will allow you to disable or enable location for each app.
Push notifications: The iPhone’s existing Push Notifications API, introduced in iPhone 3.0, is one available to developers that already runs in the background.
Local notifications: Apple has added a new service called Local Notifications, which lets apps launch notifications without the need for an external server. Using this API, Forstall said, you can have a TV guide app alert you when a show is beginning.
Task completion: This API is designed for apps that can take a while to finish certain tasks - for example, uploading photographs to Flickr. Now you can switch to other apps and let Flickr finish its business.
Fast App Switching: An app will be able to dump all information related to its current state and go into a sleep-like mode where it consumes no processor power. When you switch back to the app, everything returns to exactly the point where you left it.