iPhone multitasking

It’s no secret that “multitasking” is one of the great new features of iOS 4. Unfortunately, many people have a misconception about what Apple has implemented. Hopefully this short essay will help you understand the restrictions and the good reasons for having these limits.

On your desktop, multitasking means that any application or process can run at the same time as another. Technically, there’s no reason why the same can’t be done on a mobile device. However, from a more practical point-of-view, there is one good reason why you don’t want this: a running app uses energy that decreases your battery life. Running fewer apps means you can listen to music longer, make more phone calls, or call up Maps at the end of the day to find a place for dinner.

At the same time, there are certain types of app that must run in the background in order to be useful. Apple has identified three categories of apps:

  • Audio – Apps that plays audible content while in the background. The poster child for this type of application is Pandora.
  • VOIP – When you’re making or receiving phone calls over an Internet connection, you’re using a “Voice Over Internet Protocol” app that runs in the background. Skype is a good example.
  • Location – Some applications need to run in the background so they can keep track of your current location. An app that logs GPS coordinates while you take a walk or run would need to do this.

Additionally, apps can tell iOS 4 that they need additional time to complete a task or want the user to be notified at a specific time. This lets apps finish a long download or pop up the little blue window like an incoming SMS message.

These simple rules cover a wide variety of situations, but there are still some cases that aren’t covered. The main shortcoming is with apps that need to periodically refresh data. Social networking apps, chat programs, news readers, and other utilities that check the Internet for changing data don’t fit into any of the above categories. Developers have proposed solutions to these problems, but there’s no solution for today’s software.

Part of the confusion with multitasking comes from Apple’s excellent implementation of “task switching”. When you double-tap on the home button and start another application, the previous application is “frozen” and put into a state where it’s not running but can be restarted quickly. A part of the freezing process also reduces the amount of memory being used: allowing more applications to fit in freezer.

The next time you tap on the app’s icon, it is “thawed out” and put back on your iPhone’s screen while the previous app is frozen. This process is repeated each time you launch an app.

This sleight of hand makes it feel like you’re running many more applications than you actually are. It also explains how your iPhone can continue to have great battery life while you interact with many different apps. Most of your apps will be frozen and not using power: only the app on your screen is active. And even with audio, phone or GPS apps that are running in the background, you won’t be using more than one of those at a time (go ahead and try to listen to Pandora and the iPod apps at the same time!)

Hopefully this short explanation helps you understand that the developer of your favorite app isn’t being lazy about doing refreshing in the background! If you feel strongly about this situation, the best thing you can do is give Apple some feedback.

Updated July 1st, 2010: Matt Neuburg has written an in-depth explanation of fast app switching at TidBITS.

WORLD WILD DEBACHING CHOCK

DEAR LOSERS WHO ARE GOING TO WWDC HERES MY GUIDE TO MAKE YOUR TRIP PLEASENT IF YOU KNOW WHAT I MEAN

CHOCKTUB

APR 23 SO THIS GUY @MACGUITAR GETS IN THE HOT TUB AND SAYS HE WANTS TO SHOW ME HIS THINGS WHAT A WEIRDO MADE @GRUBER JEALOUS TO

CHOCKTUB

APR 24 @jsnell BE CAREFUL OR I WILL MAKE YOU GET IN THE HOT TUB WHAT KIND OF WHINE DO YOU LIKE

CHOCKTUB3

MAY 8 WELL LOOK WHOS SHOWN UP AND HE BROUGHT SOME READING MATERIAL COULD IT GET ANY HOTTER IN THIS TUB I HOPE SO

CHOCKTUB4

MAY 9 NOW THAT @SIRACUSA HAS FINALLY SHUTUP ABOUT HIS DEEP FEELINGS FOR LARRY WALL WERE GOING TO LEARN ABOUT THE BLINK TAG FROM JEFFRAY PARTY ON

CHOCKTUB5

MAY 13 OK WHO LET THE CHICKS IN I TELL YOU WHAT IF SHE STARTS UP WITH THE POETRY SHELL BE LOOKING FOR A WORD THAT RHYMES WITH PALM

CHOCKTUB6

MAY 16 WHO THE HELL LET THE KID INTO THE HOT TUB BOY BE CAREFUL OF THE GUY BEHIND YOU HELL WANT TO SHOW YOU HIS THINGS YOU CAN LEAVE YOUR HAT ON TO

CHOCKTUB

MAY 19 I THOUGHT CATS DIDNT LIKE WATER THAT SNEEKY BASTARD @SOCKINGTON IS PROBABLY GOING AFTER MY WHINE

CHOCKTUB

May 21st Looks like Twitter’s avatar uploading is broken. Again.

MAY 21 OR MAYBE IT WAS JUST THAT @ATEBITS AND ME BEING IN THE SAME TUB WAS TO HOTT TO HANDLE

MAY 21 IN MORE IMPORTANT NEWS TWITTER FIXED THERE SERVER SO THE CACTUS FITS IN THE HOTT TUB AND @GRUBER THOUGHT SITTING IN MY LAP WAS PRICKLY

CHOCKTUB

MAY 29 SO ITS BIKINIS ON MONDAY AND WOLFS SHIRTS ON TUESDAYS WHAT ARE WE GOING TO WEAR THE REST OF THE WWDC WHEN WERE NOT IN THE HOTT TUB

MAY 29 AN IMPORTANT AVATER UPDATE IS NOT WORKING AND NO IM NOT WEARING A BIKINI IN IT BUT ITS BETTER

MAY 31 HEY HEY IT LOOKS LIKE THAT FOXY @TJW DUDE LOST HIS HAT ON THE WAY TO THE HOTT TUB AND WHAT THE HELL DOES INMO MEAN http://twitpic.com/59r88

CHOCKTUB

JUN 3 WHO LET THE DOGS OUT THIS HOTT TUBB IS FULL OF PARTY ANIMALS NOW MOOF MOOF MOOF MOOF http://bit.ly/QNz2G AND DONT SPILL MY WHINE

CHOCKTUB

JUN 4 I LOVE TO CUDDLE WITH TEDDY BEARS ESPECIALLY IN THE HOTT TUBB WONDER WHO LET HIM OFF THE FARM IN THAT KEEWEE COUNTRY

CHOCKTUB

JUN 4 OH CRAP ANOTHER BEAR SHOWED UP BUT THIS ONES CANADAIAN AND HES GOT HIS EYES ON MY DRINK HES ALMOST A FRENCHIE TO

CHOCKTUB

JUN 5 WHOA SOMEONE AND THERE ROCK HARD ASS JUST SHOWED UP IN THE HOTT TUBB NEVER SEEN SUCH FANCY SWIM TRUNKS EITHER WHAT AN PARTY ANIMAL

CHOCKTUB

JUN 5 THE HOTT TUBB IS GETTING SO FULL WERE ONLY ALLOWING SUBATOMIC PARTICLES FROM THE HARDON COLLIDER MAYBE HIS EXISTENCE PROOFS THE THEORY

CHOCKTUB

JUN 5 @Curvyboom YOU CHICKS SPEND ALL YOUR TIME ON FACEBOOK PLANNING LUNCH AND WAITING IN LINE FOR THE TOILET NO TIME TO PARTY WITH US ANIMALS

JUN 6 WITH ALL THE CHICKS SHOWING UP FOR WWDC I KNEW ONE OF THEM WOULD TRY TO SNEAK INTO THE HOTT TUBB GOOTEN MORGEN MINE FRAULINE ICH HABEN CHOCK

CHOCKTUB

JUN 6 IT LOOKS LIKE SOMEONE WITH A TELETYPE SHOWED UP TO THE HOTT TUBB ID KICK HIM OUT BUT HIS PALMS LOOK DELICIOUSLY FLESHY

CHOCKTUB

JUN 6 @dsandler ITS EASY TO EXPLAIN JUST SAY THAT ITS PINK AND WARM

JUN 7 ANOTHER DAY ANOTHER CHICK IN THE HOTT TUBB SHES ALMOST AS PINK AS I AM AND I THINK SHES LAUGHING AT US NOT WITH US WONDER IF SHES MARRIED

CHOCKTUB

JUN 7 @AmyJane ILL MAKE SURE TO WHISPER POPS IN HIS EAR WHEN WE HAVE OUR ANUAL SNUGGLE

JUN 8 YOU LOSERS WHO DIDNT COME OVER TO THE YERBO BUENO HOTT TUBB MISSED OUR SURPRIZE GUEST DURING THE KEYNOTE @GRUBER WAS SO EXCITED HE PEED

CHOCKTUB

JUN 9 ITS GOT SO CROWDED IN THE HOTT TUBB LAST NIGHT I HAD SOME GOLDEN GATES INSTALLED SO YOU CAN ALL LEAVE NOW

CHOCKTUB

JUN 10 SOMEONE TURNED UP THE HEAT ON THE HOTT TUBB LAST NIGHT AND IM STILL FEELING A BIT WOOZY ALSO SEEING GRUBER SWEAT IS NASTY

JUN 10 OOOOOOHHH FUZZY BALLS ARE TICKLING MY NOSE IN THE HOTT TUBB AFTER FREE BEER AT THE MAC WORLD

CHOCKTUB

JUN 11 YEAH ITS TRUE I MAY BE GETTING OUT OF THE HOTT TUBB TO PERFORM AT A BASH WORKING OUT DETAILS WITH THE LAWYERS

JUN 11 FRICKEN LAWYERS WONT MEAT MY DEMANDS FOR THE YERBO BUENO SHOW MAY HAVE TO GET A FAMILY MEMBER TO DO IT STAY TUNED FOR OFFICIAL CHOCK ROCK

JUN 11 BTW DONT FOR GET TO USE CHOCKROCK WHEN LOCALIZING FOR JAPAN

JUN 11 IF YOUR LOOKING FOR THE HOTT TUBB ITS CONVENIENTLY LOCATED NEAR THE FOUNTAIN AND KEGS LOOK FOR GRUBER IN HOTT PANTS

JUN 11 YES I AM LIVE TWEETING THE BASH TURN OFF YOUR FRICKEN PHONE SO I GET SIGNAL LOOSER

JUN 11 HOTT TUBB http://yfrog.com/5hgdgtj

HOTT TUBB

JUN 11 CAKE IS BEING SERVED IN THE HOTT TUBB BEER TO

June 12th For me, there will never be a beer bash as special as the one this evening.

JUN 24 AND YOU THOUGHT I WAS JOKING ABOUT MY BUDDY STEVE BEING IN THE HOTT TUBB http://bit.ly/Y8MCf A MAGIC MOMENT

Don’t design for early adopters

If you’re like me, the iPad has changed how you look at computers in just a matter of weeks. The possibilities for this device seem endless. It’s natural at this point to start thinking about the future, and to do that thinking in terms of the past.

As an example, we’ve been getting plenty of feature requests for Twitterrific that ask for features and capabilities that exist in other mobile and desktop software. That’s not surprising, since one of our early decisions with the iPad app was to trim the app down to its bare essentials.

Part of this had to do with schedule constraints. Sixty days was not a lot of time to build a product from scratch.

But a more important reason for paring back the design was to simplify the user interface. A new kind of user is about to be introduced to a computer that they can actually use: less interface is more as far as they’re concerned. We designed our iPad app with our families in mind, not the Twitter power user.

It turns out that our design intuition was pretty good:

The non-tech-savvy users want something simple, to push an icon and get your e-mail and go online. With the iPad, people don’t feel intimidated by it.

Mary Elizabeth O’Conner

To this technical-ninny it’s clear
In my compromised 100th year,
    That to read and to write
    Are again within sight

Of this Apple iPad pioneer.

Virginia

Even folks that have access to the latest and greatest technology are preferring the iPad over more complex devices. Initial statistics also show that the iPad has an older demographic.

Of course, 300,000 geeks like you and me don’t fall into that category. We’re the first ones standing in line at the Apple store, and the first ones to use all this cool new software. And we know all the things that apps “used to do”. And we want all sorts of other bells and whistles. And we’re wrong.

As a developer, you should be very careful about this early feedback for your app. Simplicity is the name of the game in this new world order. You don’t maintain simplicity by adding tons of features.

Two of the most requested features after the 1.0 release of Twitterrific for iPad were Instapaper support and photo uploading. If you think about these things, both have a high cognitive load. To use Instapaper, you need to know that:

  • The service exists, and that you can signup for an account.
  • That you can install a bookmark and use it to save pages from your browser.
  • That these saved pages can be synced to your iPad using another application.

For photo uploading, you have to know how to do one of these things in order to “get a picture”:

  • Use the camera connection kit to transfer photos, or
  • Take a screenshot with a non-intuitive gesture (the power and home buttons), or
  • Tap and hold on a picture in a web page and save it to an album, or
  • Create events in iPhoto and sync them with iTunes

Ask yourself if you could explain any one of these things to your mother in less than 25 words. I know I can’t and I’m pretty good with this kind of stuff.

Of course, these are both useful features and we added both of them in subsequent releases. In the case of Instapaper, the feature doesn’t even show up in the UI until you go into the Settings app and add your account information. My mom will never see it.

Photo uploading is a simple button on the compose screen that lets you choose a photo from your library. Eventually, our mothers will figure out how to add things to the photo library and use that feature. But they’ll be happiest when a future device let’s us put a “Take Picture Now” button on that screen.

It’s very easy to get caught up in the excitement this new device has generated in the last month and a half, but the real thrill will be in a year’s time when people who’ve never used a computer will be telling you how much they love your app. And there will be a lot more than 300,000 of them…

Updated: Check out similar thoughts from my colleages: David Lanham and Gedeon Maheux.

A lot of typing

I’ve always wondered what it would be like to write a book. Now I know. It’s the hardest thing I’ve ever done, but rewarding beyond words.

For those of you asking for PDF or Ebook editions, you can order them now directly from O’Reilly. The printed version will be available in a couple of weeks. The “Look Inside” feature at Amazon.com will give you an idea of what the book covers. I’ve also written an overview of each chapter. (And for those of you who are dying to know, the CHOCKLOCK first appears on page ix.)

If you think you know everything about iPhone development, this book will probably prove you wrong. I learned a lot while writing it, and it’s my sincere hope that you’ll benefit from reading it.

Communal computing

Dear Steve,

First, let me congratulate you and everyone at Apple on the release of the iPad. From my dealings with your company, I know it wasn’t easy. Thanks to everyone for busting their asses: a lot of very complex puzzle pieces came together during those last 60 days!

I recently had an encounter with Bill Atkinson. I told him that “I haven’t had this much fun with a computer since 1984.” He laughed, said “Thanks!”, and went back to working on his iPad app. We, and many other developers like us, are completely smitten with this new device.

After owning an iPad for a little over three weeks, it feels like we’re dealing with something much bigger than that Mac we all got excited about over 25 years ago. I’ve been struggling to define exactly what that is: beyond the technical specifications like the beautiful screen with its large multi-touch surface. Those specifications define what the device can do, but not what it means in our lives. I want to understand the magic.

Last week, much of that meaning came into clearer focus at a birthday party for my brother, niece and nephew (April is birthday month in our family!) My wife had loaded our iPad with photos from a recent trip to see the desert wildflowers in Anza Borrego and my 50th birthday party from the week prior.

Predictably, people’s initial reaction was “Wow, that’s the new iPad!” But that quickly faded as I opened the Photos app and passed the device around. My family was more interested in sharing the photos than talking about the new technology.

I was particularly interested in how my mother, the quintessential technophobe, would react to the device. She picked up on things quickly and was flipping through photos in no time. It astonished me how the interface disappeared for her: at one point she subconsciously licked her finger before “flipping” to the next photo.

As interesting as it was to see someone non-technical use the device, the real eye opener was how several people could interact with the iPad at once. Much of my mother’s fear of computers was overcome because she was looking at the pictures alongside my sister-in-law who helped her out when she got stuck. Learning was organic.

My niece also discovered some of the games I had on the device. One, Abca, was a hit because many people could play it at once. I’ve always played the game by myself and was surprised at how much fun it was to have other people guessing words simultaneously. A group of people transformed the software into something no developer had ever expected.

All of this led to the revelation that we’ve begun a new age of “communal computing.” The desktop revolution centered around empowering individuals: this new revolution will extend that empowerment to groups of people.

The iPad was naturally passed around amongst the partygoers. Many people interacted with it during the evening, and I lost track of who had it at any given time. And therein lies a fundamental problem.

My iPad has a lot of personal information on it: email, business documents, and financial data. When you pass it around, you’re giving everyone who touches it the opportunity to mess with your private life, whether intentionally or not. That makes me uneasy.

It’s hard to fault Apple for this shortcoming. The secrecy of the project undoubtedly limited the amount of group interaction your designers and engineers would experience with their new creation. The social aspects of this device is probably just as much as revelation to them as it is to me.

I can envision several ways to solve this problem: either with a traditional login screen or with something new like folders that require a passcode to open. I have no doubt that your designers can find something elegant that gives me peace of mind as I share my iPad with friends and family.

Thanks for your time and consideration,

Craig Hockenberry

Updated April 30th, 2010: I filed Radar #7922808 for this issue and it was marked as a duplicate of Radar #7584426.