Multitasking on mobile devices

The other day when Apple announced what’s coming up in iPhone OS 4.0, they finally brought multitasking to the iPhone. With the rumors going around online for a while, I posted a to Twitter wondering why people wanted this so bad.

The biggest response has always been “I want to listen to Pandora while I do ________”. I don’t use Pandora, I mainly use my iPod Classic for music at work (I used to use my iPhone, but would use the iPod app).  There are obviously other reasons too, but this is usually key by far. Others are ‘I want to keep my chat app up (which can be handled with Push Notifications rather well)’ and ‘I want to switch/share between apps more (which I feel is very valid, and somewhat implemented with launching other apps through URL schemes, but not as good as it could be)’.

Since I have been using my iPhone, I could only think of a few times that I would want it. Maybe quickly moving data around (which I can use copy/paste for now), checking Safari while doing something else, having my feed reader update itself, etc. Nothing really urgent for a phone, and I personally would rather have long battery life than some of these features.

The iPhone OS already supports multitasking. All of the Apple apps do it. And if you jailbreak your phone, you could do it too. If you have ever done this, you will notice it is a rather poor user experience (the phone gets sluggish and battery life sucks). Obviously Apple did not want this user experience, and therefore just didn’t allow it for 3rd party apps.

Now I am not knocking other phone OS’s, but the general experience when it comes to multitasking is just as crappy. I remember numerous crashes or delays on my old WM5 phone, because an app would get stuck, and bring the whole phone down. I have seen the Facebook app on the Blackberry I used to use before the iPhone kill my battery because I accidentally left it open all day.

Now think on how you use a normal computer. For me, I always have iChat, iTunes, Mail.app, and Tweetie running, plus whatever I am doing at that moment. Other than checking those services, you are nearly always in that main application (say Xcode, Safari, iPhoto, whatever). So even though you are multitasking – you generally are working in ‘one’ thing…with different services alerting you otherwise (or yes, having a Safari window open to something while working in another application).

Now back to mobile devices – your scope is usually much more limited. I either want to make a call, play a game, check Twitter/RSS feeds. Yes, you may want to listen to music while doing this, as you can now with the iPod app. And maybe you want to be on a chat app too. This is already available by using a push enabled app. Im not sitting on my phone (or even iPad) all day coding/writing, etc. Other than communication, mobile devices are generally for media consumption.

This gets me back to my main point. Because of this limited scope – I generally don’t have that much going on in the background on my phone. And compared to my other bad phone OS experiences (BB and WM), I don’t want to relive that on my current device.

Most other mobile os just close your GUI and put it in the background. Android is a little bit different – they allow you to spin-off other threads into background processes. When the phone needs more resources, the older background processes are killed off. Apple took some time beyond that (and I agree, it was a bit too long) to think this through a little more. If they could itemize some of the background types, they could save power, stay fast, and have an elegant solution.

They came up with:

  • Background Audio – from the screenshots, it looks like they will allow the application to keep the audio stream open, plus get the extra features like the lock screen controls. I am surprised by this, since music is a key part of Apple’s business, and this competes with that.
  • Voice Over IP – Instead of Skype using push notifications (which they had been allowed to do, plus voice over 3G), they can use this. I am sure this is why Skype has been so quiet once the rules were lifted on actually producing anything.
  • Background Location – Two ways, one is GPS based for things like GPS applications (so it could give you directions while maybe you are using Safari), but also social media apps like Google Latitude or Loopt that update your location in realtime.
  • Push Notifications – The current system in place. Developers have a server solution as well, that pushes messages to Apple, who pushes them to the phones.
  • Local Notifications – Similar as above, but now you don’t need Apple. They didn’t go into detail on this, but I assume you will be able to automatically push stuff to an iPhone if needed.
  • Task Completion – Certain tasks could be started in an application, and then that application quit, with the process running in the background for a bit longer. You actually have this slightly already – apps have a few seconds after they quit for final tasks. For example, I used to use Byline for RSS reading, which would take this time to do a final sync.
  • Fast App Switching – mainly persisting your state when you quit. Then, when you come back, you are right back to where you were. This is already done in a few apps, like Tweetie, but wasn’t a standard.

To me, this entire multitasking ‘stack’ makes their previous iPhone solutions (mainly the push notifications) seem like a hack. Obviously at some point they knew they had to bite this bullet, but wanted to do it much better. But they could have also had a general plan at one point, knew Push notifications would satisfy most reasons, and work on the others over time.

The one thing I am curious about is apps like RSS Readers. I was hoping for another type of task, almost like a scheduled task feature. Apps could launch certain processes (like pulling updated feeds), but were limited to the amount of time they could run and how often they can run in a set period of time. This would be very similar to how email is currently checked.

In the end, I’m happy about this, and that’s hard to portray in 140. Most of my previous tweets were directed to the ‘I don’t think we need this as much as you really think we do’. I guess it would be better said ‘I am glad to have it – but its not something I think we all need that bad).

(BTW – this was my first post from the iPad. Most of the entire post was drafted in WordPress for iPad, and then edited and linked up on the iMac).

Advertisements

Trying to learn Cocoa/Obj-C

So, after messing with it a few times, I’ve decided to really jump in and start learning Mac development (again). As I mentioned in a previous post, the last time I ‘really’ developed for the Mac was in the days of MPW and the classic Mac OS.Well, those days  are long gone (have been for a while), and now there are even new platforms (iPhone) to develop for as well.

I’ve got a few friends that have already started down this path, and just hearing them talk about some of the stuff they can do amazes me. Oddly enough, I think I may the odd one out of the bunch, not really wanting to focus on iPhone development, but actual Mac OS development. Also, i’m coming up with new ideas I could easily hack out in C#, but want to just try on the Mac first.

It’s been such a long time since I learned a new language, its going to be a totally new experience (which is odd…I’ve been a ‘Mac User’ longer than I have been a ‘PC User’). Luckily there are some really good books on the subject, as well as a great local group I get to meet with.

My objective in the end is to feel as comfortable in Cocoa as I do in .Net, and feel more in tune with the systems that I enjoy. I also hope that one day ill have a cool little Mac app that I can share here.  I have a few ideas I have been putting together and outlining, but have yet to sketch out or document. Heck, maybe my first app will be making a native Twitter app that I actually like!