Live data from Hacker News

IPhone multitasking and background updating

marco.org

21–30 of 35 posts

Re: IPhone multitasking and background updating

#21
post #12
post #10

Earlier quoted context omitted.

Starting with iOS4 developers have access to a set of APIs. Audio, GPS + 'Location', Push, Phone (think Skype), Worker and probably a few other APIs. Until now, when the user pressed the home button you were able to write your state to flash if necessary. Now there is another way to 'freeze' your app and keep the state in memory -- at least until iOS4 decides your app won't be needed soon and fully quits it to free m…

Ahh, great thanks, this is a really good summary! :) So, what is missing (i guess) is some background service API. Sounds pretty much like the Android way (minus the background service). But it should be good enough for the majority of apps, i think.

I think Apple could solve all of this by adding something as simple as a crond that executes processes at scheduled times, similar to what Marco is requesting.

I'm sure Apple would do it properly and have all apps with scheduled tasks accessible from the Preferences screen so you could disable or change the schedule of them easily.

Re: IPhone multitasking and background updating

#22
post #4
post #3

Can someone briefly explain how the "multitasking" works, then? I was under the impression that this will be possible, too. I suppose apps that are sent into the background are just frozen in their current state and continue to run where they left of, when going into foreground? Just a guess, though..

There's real multitasking for Native apps (since 1.0) and a limited multitasking for 3rd party apps (since 4.0) Edit: Downvoted? Am I wrong? Just curious

There is real multitasking for Native apps like iPod, Mail, Phone, SMS, Safari, Clock, etc. Apple has chosen to not allow other apps to run in the background on a permanent basis due to memory concerns. Indeed, the iPhone and especially the iPad runs out of memory shockingly easy. I have noticed that iOS 3.2 on my iPad is actually intelligent enough to start unloading backgrounded native apps from memory when I get low on RAM. I'm running SBSettings and Backgrounder on a jailbroken iPad and I can see that when I get down to about 10-20MB free apps will start getting closed.

As long as these idevices only have 256MB of RAM this will be a problem. I think the approach Apple is taking is the right approach. An app like Pandora should be able to spin off a "stub" process that doesn't have any of the UI overhead but simply the network and audio code to continue playing an existing stream.

These are all "hacks" that will hopefully be outdated in a couple years when we're hacking away on our A9 cortex 2 ghz. dual core iPads with 4GB of RAM.... (hey, I can dream right?)

Re: IPhone multitasking and background updating

#25
post #16

The author's suggestion for Apple to add an alarm-like service is exactly what Android has. Most of the iOS multi-tasking which Steve Job claims is better than everyone else, is also a direct copy of Android's but in a more severe limited manner. But of course everyone thinks Apple invented this.

Indeed, the alarm service does exist, but the API call you'd use (android.app.AlarmManager.setInexactRepeating()) doesn't go nearly as far as he is suggesting about being smart with power/bandwidth/CPU usage. Although it is clever how it will "adjust alarms' phase to cause them to fire simultaneously, avoiding waking the device from sleep more than necessary".

Re: IPhone multitasking and background updating

#26
This is a really simple and strong proposal. It's amazing the power that a single url fetch request can have, although the ability to post data is probably necessary for a number of categories of work (for example, any location based apps).

That these background services are not composable puts some limits on their potential usefulness, but it sounds like this plus the existing services would cover most bases.

Re: IPhone multitasking and background updating

#27
post #23

Pandora and Skype can network in the background; I don't understand why Instapaper can't. Maybe it could play some John Cage while downloading to qualify as an "audio" app. :-)

Right. The other common case is just holding a socket open, for IM and SSH clients among others. That uses much less resources than streaming audio, but it's apparently not allowed either.

Re: IPhone multitasking and background updating

#28

Part Apple's making-software-simple philosophy is that APIs are written for specific cases - you write apps for a single resolution in iOS, you call system services instead of multitasking etc. The advantage is that making things simpler allows them to concentrate and spend more time making them better, while the disadvantage is that it leaves lot of developers unable to meet their users' needs. The alternative appro…

I think you're overgeneralizing here.

Most of Apple's APIs are wonderfully general (e.g., look at their full 3d-aware Core Animation capabilities that are better than any desktop system (other than Mac OS X, which shares the same capabilities).

They specialize APIs when it would be harmful to generalize.

They're fighting at every turn for battery life (I'm at WWDC this week, and have seen that mantra (optimize for battery life) at nearly every talk), which is tough on developers but great for end users.

Re: IPhone multitasking and background updating

#29
This is the issue with Apple's 'multi-tasking' model. Want to write an alarm clock replacement? Can't do it, you need a hook that doesn't really exist. This guy needs this hook. Someone else will need another hook. Does apple play os whack-a-mole (creating a lot of fragmentation)? Or are you just out of luck for a whole load of apps?

Re: IPhone multitasking and background updating

#30
post #4
post #3

Can someone briefly explain how the "multitasking" works, then? I was under the impression that this will be possible, too. I suppose apps that are sent into the background are just frozen in their current state and continue to run where they left of, when going into foreground? Just a guess, though..

There's real multitasking for Native apps (since 1.0) and a limited multitasking for 3rd party apps (since 4.0) Edit: Downvoted? Am I wrong? Just curious

:s/Native/Apple's built-in/
Post reply on HN