News for hackers. Stuff that matters.
Re:How multitasking really works on Android and iOS by masklinn on Thursday January 05, 2012 @12:17PM (#3429494)
Android provides a "puzzle piece" which is not available in iOS in the form of "services".

An Android application is composed of any number of Service components (0 or more) and an Activity (I think this is optional, so a package can provide services to third-party applications, see Bound Services[0]).

The Android "Activity" is what corresponds to an iOS Application: it's stuff with an UI which the user can interact with. An activity can not "act" in the background, if it's not visible it's frozen or dead.

A service, on the other hand, is headless (it has no UI). As a result, it has no concept of "foreground" and "background", if it's been launched it runs until it's been killed. I believe services also have little to no restrictions.

In Android, background activity (for applications needing those) is generally implemented via a dedicated service. These services can do whatever they want, which is a strict superset of Apple's limited set of backgrounding APIs. A drawback is that, because services can implement arbitrary behavior, it's harder for the OS to optimize them and it leaves them more open to abuse or coding errors than iOS's (or WP7's) more limited multitasking provision.

tl;dr: Android offers pretty much full multitasking, iOS only offers a limited, Apple-defined subset of it unless you jailbreak.

[0] http://developer.android.com/guide/topics/fundamentals/bound...

There are no comments on this comment yet.