Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


 
 

New Facebook apps show that HTML5 is not a silver bullet

Posted by Alan Zeichick on Sep 3, 2012

The new Facebook v5.0 app on my iPhone 4 is great. It's instantly responsive to touches and to load new data. The user interface has nice animations for actions like pressing the "like" button. Photos appear almost instantly. In every way, the new app is superior to the previous version.

The new app is native iOS software built using Objective-C. The previous versions were written in HTML5. Both were distributed through the Apple App Store, and installed onto the phone. However, the native code is an order of magnitude better.



Well done, Facebook.

One of the premises of HTML5 is that, because it's an industry standard, developers should be able to write-once-run-anywhere software -- that is, create a single codebase that produces apps that will run on iOS, Android and Windows Phone with a minimal of tweaking. That's very true.

Even with HTML5, some customization is usually needed, such as for optimal use of a specific device's screen size and conformance to a platform's informal user-experience norms. Even so, generally speaking, you can develop and distribute credible cross-platform apps using HTML5 for a fraction of the cost of creating a whole array of separate native apps.

What you get, though, is a lowest-common-denominator app.

Even with some tweaking, the HTML5-based Facebook app didn't truly feel like an iOS app. Sure, the app felt consistent across both my iPhone 4 and my HTC Evo phone, but it's more important to have an app fit a platform's native UX, not to have consistency between the app running on multiple platforms.

One of the engineers on the Facebook team, Jonathan Dann, wrote an extensive blog post about the experience: "Under the hood: Rebuilding Facebook for iOS." Let me share some excerpts:

At first, Dann explains:

To support thousands of devices and multiple mobile platforms, we leveraged HTML5 to build and distribute Facebook mobile experiences across iOS and other platforms. By allowing us to write once and ship across multiple platforms, HTML5 has historically allowed us to keep the Facebook mobile experience current and widely available, and has been instrumental in getting us to where we are today. We chose to use HTML5 because not only did it let us leverage much of the same code for iOS, Android, and the mobile web, but it also allowed us to iterate on experiences quickly by launching and testing new features without having to release new versions of our apps.

The drawback was speed, he writes:

… we realized that when it comes to platforms like iOS, people expect a fast, reliable experience and our iOS app was falling short.

By writing a new native app using Objective-C, the Facebook team could leverage both iOS SDK features and also take advantage of multithreading. For example, Dann says:

One of the biggest advantages we've gained from building on native iOS has been the ability to make the app fast. Now, when you scroll through your news feed on the new Facebook for iOS, you'll notice that it feels much faster than before. One way we have achieved this is by re-balancing where we perform certain tasks. For example, in iOS, the main thread drives the UI and handles touch events, so the more work we do on the main thread, the slower the app feels. Instead, we take care to perform computationally expensive tasks in the background. This means all our networking activity, JSON parsing, NSManagedObject creation, and saving to disk never touches the main thread.

Facebook hasn't announced whether it will create native apps for other mobile platforms, such as Android or Windows Phone.

The challenge with Android is that there are so many different difference and versions of the operating system floating around, it may be hard to draw a baseline and create a compelling single app. However, given the huge number of Android devices on the market, Facebook will feel compelled to ensure that the Android user experience is equal to that on iOS.

In terms of Windows Phone, Microsoft is rebooting the platform with the forthcoming Windows Phone 8 -- and Microsoft will want this high-profile application to be fast and beautiful. I wouldn't be surprised to learn that Microsoft is working with Facebook to deliver a native app WP8 on Day 1.

Bottom line: HTML5 is fast to write and gives you a cross platform codebase. But native is better, if you can afford it.

TAGS:

HTML5, Facebook


Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap