views:

510

answers:

7

I tried to find an explanation for this question, but couldn't.

I am new to iPhone development and I was wondering why the iPhone cannot allow/run more than one app at a time?

I am pretty sure this is a design feature rather than a lack of functionality.

Could someone please explain to me in technical/non-technical words why you can't run more than one app at a time in iPhone.

Thank you very much.

+1  A: 

Because it would use up a lot of battery. If you've got a jailbroken device, you can run multiple apps at the same time with the Backgrounder app.

eWolf
+2  A: 

Apple are very protective about how their phones get used. It took a while before they allowed even one third party app to run!!

There is no technical reason beyond Apple placing the limitation in their software. Because a phone has fairly limited resources, Apple figured that it would ruin the user experience if there were several apps running, slowing down the currently visible app.

On Jailbroken phones it is possible.

Mongus Pong
+3  A: 

This was actually explained in one of the keynotes. They wanted an easy way to manage processes so they wouldn't suck down battery life and processing power, so the only thing that you can run in the background is the iPod app.

ygd
And Mail, and I think sometimes Safari.
Kendall Helmstetter Gelner
No, Mail uses push notifications, which was Apple's alternative to multi-tasking.
ygd
A: 

<cynic>They want you to buy the iPhone 4GX (now with multi-tasking!) in 6 months.</cynic>

The hardware can handle it - jailbroken iPhones can do it, and other phones with similar hardware can too. Here are some possibilities as to why it hasn't happened on the iPhone yet:

  • they haven't figured out a good interface for managing multiple tasks (no small feat)
  • they are worried about battery life (their stated reason)
  • they don't want background apps to slow down active apps
  • they (seriously) are waiting to charge you for it, just like they did with video

I'll wager it's for all these reasons to some extent, but probably not much of the last one. They've spent a LOT of effort on workarounds (notably push notifications and data APIs) to allow some backgroundy features. I they must think that it's worth it not to have true multitasking.

Also note, almost all of the native apps (definitely Safari, Mail, iPod, iTunes, Phone, and Maps) are always or can be running in the background.

Jerph
A: 

It's simply an iPhone architecture decision. Though there are some backgrounds tasks, and limited threading, it's a single application environment for the most part.

Future OS versions may not be, and you do need to know what calls are thread-safe and which are not, but you have to assume at the moment that your application is the only one running.

-t

Tim
I don't like your muxing threading issues in on the discussion. Multi-process communication methods are quite distinct from thread communication methods.
Frank Krueger
I agree with Frank, and anyway, it's only a "single application environment" for third party apps. The only thing that's really missing is a way to view and kill unruly apps, other than by a full reset.
Jerph
I never said you could run multiple applications, only that there is a level of multi-threading available for those who might benefit from this feature.You can read all about it in the Threading Programming Guide if you are not familiar with it.
Tim
Tim, you are being rather obnoxious here. I'm pretty sure Frank "is familiar with it" (multithreaded programming), that was rather insulting. Your original post basically implied that if other apps were running your app would have to be written to handle multithreading, which is simply not true. That may not have been your intent, but that was how it read.
Kendall Helmstetter Gelner
+5  A: 

Here' why:

It's very frequent, on discussion boards related to other smartphones like the Android, etc, to have users asking questions like "why does my battery sometimes run out really fast?", and "why does my phone get slower and slower?". The answer inevitably received from the community is the obvious one: go to the task manager on the phone and stop some of the extraneous programs that you have running. It's not a tough thing for a reasonably-savvy user to manage their available resources.

On the iPhone, Apple decided that they valued the overall experience more than flexibility, and so they made the decision to limit the phone to one (third-party) task to prevent the above scenarios. Whether you agree or disagree with the decision will vary from person to person.

phoebus
+1  A: 

I think they made the right decision with the way the system is currently implemented.

I think there are a few exceptions:

  1. It would be nice if apps, with permission from the user, could schedule themselves to run at a particular time. This would allow proper alarm application.
  2. Allow audio to be played in the background from an application. This would make things like Spotify work better.

As soon as you start having more than one user application running, you have start thinking about managing those programs that are running. While for us lot this would not be a problem, for the average joe it's an unnecessary complication. In fact, I would go as far as saying that the single running program perceivable model would work well for the fast majority of users on their big computer ;-)

lyonanderson
Audio in the background is of limited use if you can't do networking (Pandora and NPR are my wish-list apps) and networking is the problem. Honestly, I love my iPhone, but I'll probably switch to get the ability to run networked media in the background.
Jerph
Agreed, I think we'd all like to be able to have Pandora or Spotify running in the background. My phone is currently Jailbroken. The only app I use with backgrounder is Spotify. Given Apple review every application it's possible at some point in the future they'll let apps of this kind work in the background.
lyonanderson