True Multitasking

Story Side

My first smartphone was an Android phone, the HTC Desire to be more specific. I installed many apps on it that truly utilized multitasking in such a seamless way that I never paid any attention to it. I took the superior multitasking for granted.

A few months ago, when my Samsung Omnia 7 (Windows Phone 7) got the WP7.5 Mango update, I was excited to get multitasking on it! I installed WhatsApp and was shocked! Why did it have to load the new messages after I opened the app when I just received a notification of that message? It made no sense to me. I blamed it on the fact that the app was still in beta.

After going to a developer conference hosted by Microsoft, they explained how exactly WP7 dealt with multitasking. They explained about how the app is “tombstoned” when it is not the active app, which is basically freezing the state of the app rather than quitting it. Android, on the other hand, kept my apps running in the background unless they were specifically closed.

I didn’t dig too much into it though, since my Android was still my main phone. Then one day, my HTC Desire faced an unfortunate accident that killed it. I borrowed an old iPhone 3GS from a friend as a temporary smartphone to use until Q2 when HTC releases its next hero phone. And now this iPhone has become my main phone.

So I install WhatsApp, Facebook, Twitter and all the other social apps I use. I set them all up to give me live notifications of everything I care to know about. So I get a WhatsApp notification and I click it… WhatsApp is connecting… WhatsApp just connected… WhatsApp just received the new messages and can finally be read. How long did that take? Around 3 seconds between the app loading and then the data loading. How long would that take on my Desire? Instant, thanks to the power of true multitasking! I noticed that was the case with all my apps and it’s really been driving me crazy.

Technical Side

Now for the slightly more technical side of the article, here’s a brief conceptual explanation of how multitasking works on WP7 and iPhone VS Android:

On iPhone and WP7 (terms and fine details slightly defer, but concept is the same):
An app basically has 2 states: active and suspended. When it’s active, of course, the app is in the foreground and is what’s running. When it’s suspended, the app is enters a frozen state where nothing is happening, but can easily be thawed out of this frozen state to go back to exactly how it was. Of course, there are pausing and resuming events, where the app is told that it is about to be frozen or that it is about to be thawed for use again, so run whatever you need to to get ready.

So you’d wonder, “how can I send a notification to my app if it isn’t running?” Well, you don’t actually send it yourself! What you do is basically send the notification to Apple/Microsoft and tell them what phone to send the notification to. When the phone gets the notification, your app is not actually aware of the notification. Clicking this notification will only tell you phone that the user clicked a notification of type x (example: a private message notification, so launch the app at the inbox).

Big example: Instant messaging client:
Method 1: User directly connects to IM server:
In this case, the user has a direct connection to the IM server and gets his/her messages directly. When the user navigates away from this app, he/she is disconnected (perhaps you, the developer, would like to run some code to disconnect the user in a safer manner or save some information). While the app is suspended, the user will not receive any messages. Running the app again, the app should try and reconnect to the server and retrieve new messages.

Method 2: User connects to app server, which connects to IM server:
The user sends their login information to your server. Your server connects and acts as a sort of BNC; it connects as the user and relays all the messages to the user. In this method, the user will never get disconnected and will always get live notifications, whether the app is running or not. Of course, this makes it a lot more costly for you to have the server running at all times relaying the messages. The app becomes slightly simpler on pause and resume. On pause, app notifies the server of the disconnect, so it can start pushing the notifications as phone notifications. On resume, the app reconnects to the server and requests that the messages are sent in to the app now instead.

On Android:
The app can run in the background keeping an active connection to the IM server. In the background, the user can get the notification and the app will automatically be updated with the information.

In conclusion, life is much simpler on the Android side of things, huh? So it seems, but the can also slow down the OS, drain the battery and cause a lot more malware! Of course, when efficiently used, this is a very effective and powerful platform for multitasking!


The Magical Little Details

This morning on my way to work, there was a red GMC in front of me. Suddenly, it looked like a bubble came out of the muffler of the car. I was shocked! Next, I noticed there were 2 little girls fighting in the back seat of the car. Then, a world of bubble blows out the left window of the car! I felt I was caught in a dream. I looked into the car and it seemed the 2 girls were giggling uncontrollably and then a lot more bubbles from the right window.

It’s these little things in life that matter the most. It’s mainly in these little details do we truly find utmost beauty. If you can’t appreciate these little things, then what can you appreciate? Life is all about these little pointless details that just put the cream on top and somehow really do wonders.

These little things are among the most important things for me in everything, including my programming. When you fine tune your product to be so perfect with these little surprises, the customers will be much happier with what they are getting their hands on to. A wonderful example I came across with Windows Phone 7, any long list, like your list of apps or your contacts, there is a box with the letter the next few apps/contacts are going to start with. If you click that box, it gives you a list of all the letters to jump to another spot in your apps/contacts.

Apps List Letters List

I try my best to make sure everything I do has these wonderful little details. And these are the kind of details you can’t let the customer know about! These are the beautiful little things you need to see if it’s done intuitive enough that the user just naturally thinks of and they are welcomed by that warm feeling of understanding the developer’s thoughts.

Nokia’s latest ad campaign, “The Amazing Everyday,” has been a huge inspiration to me. I really like it and appreciate the message it’s delivering, even if it doesn’t seem to advertise Nokia so explicitly.

The Little Amazing Show ep 1
The Little Amazing Show ep 2
The Little Amazing Show ep 3
The Little Amazing Show ep 4
The Little Amazing Show ep 5
The Little Amazing Show ep 6

So remember, focus on the details. Deliver polished products. It’s as important for something to be beautiful and intuitive as it is for it to have features that work. Beauty may be in the eye of the beholder, but if you deliver a product that extraordinary, you’ll have a huge following! Most importantly: open your eyes and absorb all the beauty in life and everything you see because it’s everywhere and absolutely magical!

New Year’s Resolutions

I think new year’s resolutions are very helpful. Many people disagree and they probably aren’t helpful for these people. People are such simple creatures. Many people can be motivated by simple things that it’s sometimes shocking! How many times have you heard someone say “Alright, I’m starting my diet next week!” or “at the beginning of next month!”? People see the start of a new period of time (ex. day, week, month, year, etc.) as an excellent motivation. I personally only find the start of a new year to be particularly special, as a result that is the only time a resolution of sorts works.

Since it’s not that frequent the I get the chance to use a new time period as my motivation, I decided to give myself multiple resolutions this year. And this year, I’m serious about my resolutions. Some of the details are relatively private, however the general concept can be public. Here’s my list of resolutions to accomplish by the end of 2012. I’ll come back to this post and edit with my progress along with dates throughout the year.

  • Start facing problems head-on, instead of ignoring and hiding from them.
  • Start a tech-based blog and give it a serious shot, though no commitment is required. It’s more of an experiment really.
  • Work on a couple of WP7 apps to fill the void of what I find missing on the marketplace… More of a selfish task as I’m doing this for myself, but also publishing on the marketplace for all others to take advantage of as well.
  • START SAVING MONEY! I’ve been working for a year and I have nothing to show for it according to my bank account. I’ve been wasting huge amounts on such trivial things and think I could save a big chunk if I tried. I have a goal to save by the end of the year, but I’d like to see more remain.