Review: Android

Multitasking

Since I was a heavy Windows Mobile user back in the PDA era, proper multitasking on a mobile device was second nature to me. At least on my PDAs, multitasking in Windows Mobile didn’t seem to affect the battery all that much (and they had wifi and BlueTooth), so it was never a special or significant feature for me – it’s a pocket computer, of course it does multitasking.

Why was multitasking on mobile something normal back then (Windows Mobile, Symbian), while with the iPhone, it became something special? Something of a holy grail? Why did it suddenly become so hard to do multitasking without affecting the battery too much? Why, almost five years down the line, does the iPhone still not have anything other than My First Multitaskingâ„¢ (which, for all intents and purposes, is barely one notch above a list of recently used applications)?

There are several reasons. First and foremost, whereas operating systems like Symbian and Windows CE were designed from the ground up to be small and efficient on constrained hardware (which explains why WP7.5 kicks Android’s and iOS’ butt in the performance department), operating systems like iOS and Android are basically comparatively heavy desktop and server-class operating systems shoehorned into mobile devices. This obviously comes at a price.

In addition, processors have progressed much faster than battery technology, and while my PDAs already had wifi (and I even had a Windows Mobile smartphone, the HTC Artemis), modern day wifi is more powerful and probably sucks more power. I don’t believe the story about how we use our smartphones more often. In fact, I used my PDAs more often than I do my phones today, because now I also have a slim ultrabook and an iPad to take on most of the PDA’s duties.

With my history as a PDA user, I don’t consider iOS to have proper multitasking – and by proper multitasking I mean that the user has the ability to run multiple programs simultaneously. This is important, because iOS itself, of course, fully supports multitasking and all that comes with it – it just doesn’t expose it to the user. I don’t consider the capability for applications to run a few select pre-defined, Apple-approved tasks in the background to be multitasking.

In iOS, application programmers can only perform the following seven tasks in the background:

  1. Background audio – application continues to run in the background as long as it is playing audio or video content
  2. Voice over IP – application is suspended when a phone call is not in progress
  3. Background location – application is notified of location changes
  4. Push notifications
  5. Local notifications – application schedules local notifications to be delivered at a predetermined time
  6. Task completion – application asks the system for extra time to complete a given task
  7. Fast app switching – application does not execute any code and may be removed from memory at any time

Many would argue that this covers most use cases, and while that may be true, none of them address the fundamental issue with iOS and multitasking: it feels bolted-on. An afterthought. Something added only to shut up all the complainers. Here, you can continue to play audio while you run another application. Now shut up, that’s multitasking..

However, on iOS, applications still don’t really know whatever’s happening to other applications. Switching between multiple applications really means switching between applications; when you switch to another application, the previous one is killed. It can continue to do any of the above seven tasks, but that’s it. On iOS, whenever I need to switch to a different application, I feel hesitant, because I never know what’s going to happen to the previous application. Will it remember the text I just typed in? Will it remember my location inside the application?

It’s all made worse by the fact that switching between applications on iOS is a very cumbersome process. Pressing the home button twice is not a comfortable operation, because it’s very error-prone for me – I regularly end up long-pressing the button, or the second press isn’t firm enough and I end up at the home screen. It feels like Apple never intended for this functionality to be part of iOS, but after all the complaints, was forced to add it anyway.

On Android, multitasking has clearly been a design consideration from day one (mostly, but we’ll get to that in a minute), and the back button plays a major role here. The major advantage comes from the fact that applications can do a lot more while they’re not front and centre than the seven tasks applications on iOS can perform. The key to why I prefer Android’s multitasking to the seven background tasks in iOS is Android’s concept of Application Components (see Dianne Hackborn’s article on the subject for a good primer, or the more in-depth article at the Android Developers page).

Application Components “are the essential building blocks of an Android application”. There are four different types of application components, the most important of which is the activity. Each activity is a single screen with a user interface. Each application (generally) consists of multiple activities; Gmail, for instance, has an activity which displays the list of emails, an activity for composing email, and so on. Twicca, my favourite Android Twitter client, has activities for the timeline, a user profile page, compose tweet, and so on. Heck, even your homescreen is just an activity.

Second, there’s the service, which, as the name implies, is a component which runs in the background to perform tasks that take a while, and do not have a user interface. Examples are audio playing in the background, or fetching data over the network. These continue to run even if the user switches to another application.

Third, we have the content provider, which manages a shared set of application data, which can be stored in the file system, an SQLite database, or any other persistent storage location. Other applications can access or modify this data through this content provider (assuming permission has been given). Lastly, there’s the broadcast receiver, which takes care of receiving messages from other applications (e.g., telling applications a certain download has completed).

The unique aspect of Android multitasking is that each application can start another application’s components. You can see this at work when browsing the web and encountering a link to a tweet, or a Twitter user’s profile page. While on iOS it will simply open the Twitter.com webpage, on Android, you can tell the phone to open your Twitter application instead – however, instead of launching the application as a whole and switching to it, only the relevant activity is launched.

So, in the case of tapping on a web page link to a tweet, Twicca’s activity for showing a tweet is launched and shown to the user – without actually launching the entire Twitter client. The same happens when tapping a link to a profile page; Twicca’s activity for user profile pages is launched, again without launching the entire application. In both cases, a single tap of the back button brings you back to the browser. In addition, if you open the Task Manager, you’ll see that Twicca didn’t actually launch at all.

It’s precisely this ability that makes Android’s true multitasking feel so smooth and natural. Instead of hopping from silo to silo (iOS) without really knowing what the application you’re leaving behind is going to do, which can be jarring, you’re just quickly opening a single activity, and hop back trough a single tap on the back button.

It’s difficult to explain if you haven’t used Android for any extended period of time, but this is really one of the things that pleasantly surprised me. I just figured applications ran in the background, and that the concept of using multitasking on Android was effectively the same as on iOS. In reality, though, it’s a lot more well-thought out and integrated into the operating system and its user interface than is the case on iOS.

It’s not all roses and unicorns, however. While opening activities from another application and hopping back is easy and fluent, switching between applications as a whole is just as annoying on Android as it is on iOS. You long-press the home button, and a dialog pops up containing the icons of the six most recently used applications. It’s a little bit worse than iOS, even, since you’re limited to those six applications, whereas on iOS you can scroll back pretty far.

On the whole, though, multitasking on Android is far superior to the seven pre-approved background operations in iOS. I honestly hadn’t expected it would make that much of a difference, but after a few months on Android, I find my iPad cumbersome and jarring when it comes to using multiple applications.

100 Comments

  1. 2011-12-19 8:18 pm
    • 2011-12-19 8:48 pm
      • 2011-12-19 9:00 pm
        • 2011-12-19 9:02 pm
          • 2011-12-19 9:09 pm
          • 2011-12-19 9:39 pm
          • 2011-12-19 9:40 pm
          • 2011-12-20 12:24 am
  2. 2011-12-19 8:23 pm
  3. 2011-12-19 8:38 pm
    • 2011-12-19 10:26 pm
  4. 2011-12-19 8:44 pm
    • 2011-12-20 2:24 pm
  5. 2011-12-19 8:50 pm
    • 2011-12-20 7:03 am
  6. 2011-12-19 8:55 pm
    • 2011-12-19 10:11 pm
      • 2011-12-19 11:26 pm
        • 2011-12-20 2:18 am
    • 2011-12-20 3:16 pm
  7. 2011-12-19 9:12 pm
  8. 2011-12-19 9:13 pm
  9. 2011-12-19 9:21 pm
    • 2011-12-20 2:20 am
      • 2011-12-20 5:48 am
    • 2011-12-20 12:59 pm
  10. 2011-12-19 9:46 pm
    • 2011-12-20 8:25 am
  11. 2011-12-19 9:51 pm
  12. 2011-12-19 9:51 pm
  13. 2011-12-19 9:54 pm
  14. 2011-12-19 10:22 pm
  15. 2011-12-19 11:08 pm
  16. 2011-12-19 11:22 pm
    • 2011-12-19 11:43 pm
      • 2011-12-20 4:45 am
  17. 2011-12-19 11:28 pm
    • 2011-12-20 8:33 am
  18. 2011-12-19 11:49 pm
    • 2011-12-20 1:07 pm
  19. 2011-12-20 12:05 am
  20. 2011-12-20 12:15 am
  21. 2011-12-20 12:38 am
    • 2011-12-20 5:56 am
      • 2011-12-20 12:29 pm
  22. 2011-12-20 1:32 am
  23. 2011-12-20 2:14 am
    • 2011-12-20 9:55 am
  24. 2011-12-20 2:20 am
  25. 2011-12-20 8:17 am
    • 2011-12-21 8:44 am
  26. 2011-12-20 9:00 am
  27. 2011-12-20 10:25 am
    • 2011-12-21 12:23 am
      • 2011-12-21 2:40 am
        • 2011-12-21 7:19 am
          • 2011-12-21 12:46 pm
          • 2011-12-21 11:29 pm
        • 2011-12-21 8:11 pm
          • 2011-12-21 11:14 pm
      • 2011-12-21 12:27 pm
        • 2011-12-22 9:14 am
  28. 2011-12-20 10:43 am
    • 2011-12-21 3:01 am
      • 2011-12-21 10:00 am
        • 2011-12-22 1:31 am
        • 2011-12-22 9:01 am
  29. 2011-12-20 11:20 am
    • 2011-12-20 11:54 am
      • 2011-12-20 12:05 pm
    • 2011-12-21 12:30 am
  30. 2011-12-20 12:15 pm
      • 2011-12-20 6:00 pm
    • 2011-12-20 10:10 pm
      • 2011-12-21 10:48 am
    • 2011-12-20 11:47 pm
  31. 2011-12-20 4:46 pm
  32. 2011-12-21 12:51 am
  33. 2011-12-21 7:36 am
    • 2011-12-21 11:09 am
      • 2011-12-23 9:50 am
        • 2011-12-23 1:41 pm
        • 2011-12-23 1:42 pm
          • 2011-12-24 11:43 am
          • 2011-12-24 1:47 pm
          • 2011-12-24 1:48 pm
          • 2011-12-24 5:59 pm
  34. 2011-12-21 9:16 am
  35. 2011-12-21 9:24 am
  36. 2011-12-21 1:37 pm
    • 2011-12-21 3:12 pm
      • 2011-12-24 2:39 am
  37. 2011-12-21 5:31 pm