iPhone - why only one application at a time
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 th开发者_如何转开发is 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.
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.
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.
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.
I think they made the right decision with the way the system is currently implemented.
I think there are a few exceptions:
- 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.
- 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 ;-)
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.
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
<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.
精彩评论