I think you might read that title and think this is going to be about how HTML5 is steadily taking over the native app world on mobile devices. I think we hear a lot about this because thats the story people want to hear, so it gets amplified quite a bit.
The truth of the story can be summarized by slightly changing the statement. HTML5 COULD BE taking over the app world, but the people that matter don’t want it to.
I apologize in advance. This is more of a brain dump than a “blog post”. I will need to go back and edit quite a bit, but we’ve got actual work to do today, dammit! Anyway…
My theory is that neither Apple nor Google want you to write apps in HTML5, but if they did, you could. And it would be awesome. Because they don’t, its very difficult to pull off elegantly.
You could say, “but Google TOTALLY supports HTML5?!”. Yeah, but not in the app ecosystem. Its true that Goog and Apple work hard to make the web experience fairly smooth on mobile devices, but not as an app platform. You can use WebView to host content, and I’m not sure we’ve done a significant app that didn’t use WebView in some way, but as a full app platform, ideal it isn’t.
The Evidence. I will present my evidence in a few broad categories: desktop parallel examples, current phone HTML5 implementations, and current cross platform implementations, then discuss some of the misconceptions around cross platform development in general.
1) Cross Platform In The Desktop
There are a number of projects that have attempted over the years to produce an XP solution for the desktop. While some have had greater or lesser success, nothing has really been successful. Most desktop apps are built in their native environments. Most functionality has, of course, moved to the web, but if you build a desktop app, its native. This is not because of lack of effort or smarts. Its because the people that sell these desktop OS’s have no interest in XP solutions.
There was a time when Java was going to take over the desktop. You could “write once, run anywhere”. While version 1 was kind of a joke for this idea, later versions should have made that a reasonable possibility. While you could argue that Swing’s lackluster performance killed it, Microsoft’s concerted effort to prevent Java from gaining any traction was really punch in the gut. They copied it, crippled it, and did all manner of nasty things to make Java a maintenance nightmare. Most apps actually did a good job of running in different environments, and many internal apps were built on it, but right now I can only think of 1 or 2 public apps that are built on Java.
Question: How do we think this would have worked out if Microsoft had cooperated with Sun and helped Java rather than strangling it? Maybe it still would’ve been crap (Sun strangled JavaFX all by itself), but maybe things would’ve been different.
There is only XUL
For better or worse, fair or not, I would be FAR more Mac and Windows apps are built in either native Mac or native Windows development environments than anything approaching “cross platform”. This wasn’t a huge deal when Apple was still on the ropes as a company, but now that Macs are all over the place, the need for a cross platform solution would seem even greater. Machines perform better than ever, so the slightly lower performance of the cross platform solutions would seem like a minor issue. Plus, we’ve had about 15-20 years to come up with something that works well. Still waiting.
You could argue that the web is the cross platform solution for the desktop, and your argument would be pretty persuasive. I’m not arguing that things better suited to being web apps aren’t going to stay that way. I am arguing that for things that want to be locally installed may not be written in HTML5, as many seem to be predicting. The major issue with everything moving to the web for phones is how they’re used, and spotty connections. First time app developers tend to view phone development like they have an always-on connection. You really need to think of your phone like its connection is almost always off. If you don’t design that way, there’s a really good chance your app is going to perform badly.
So, anyway. History would suggest we could be waiting for a long time before a cross platform solution presents itself, assuming the major players don’t want it. And I’m pretty sure they don’t. Know why I’m pretty sure? More evidence.
2) Current Mobile HTML5 Implementations
HTML5 as a mobile device development platform is not rocket science. It is VERY possible, and has been done. If Google and Apple wanted HTML5 as a first class citizen, they could have it.
Firefox OS (aka Boot to Gecko)
Basically the same point as WebOS. A company operating on a relative shoestring is building a smartphone platform based on HTML5, and it seems like they have some interested partners. At first I thought they were insane, but they’re going after low end phones. LOW END PHONES!?!?! Again, HTML5 as a core app development language should not be hard. Its TOTALLY possible, but only if the people holding the keys want it in there. I find this move particularly interesting, as the “low end smartphone” space is dominated by Android. I would guess the average phone user is far more concerned that their phone works and they can play music than of the OS particulars. If Firefox can do a solid job with mail and contact integration, they might be able to pull off something interesting here (and if Google can put their ads and maps in there, I’m not too sure they’d be upset).
HTML5 based apps aren’t some super problem just waiting on somebody to come along and figure them out. Both platforms above were built by teams under huge time and resource pressure. It can be done. In fact, I’m pretty sure we could just copy WebOS, right? It is open source.
3) Current Cross Platform Implementations
There are multiple XP implementations out there, but the only two I find interesting are PhoneGap (now Cordova, which I’m refusing to accept) and Appcelerator. Both work. I’m not sure either works well.
I have a love/hate thing with Appcelerator. When I first tried it, I was using Linux, and although it was supposed to install on Linux, it didn’t. Android was sort of the red-headed stepchild of Appcelerator. The basic pitch was, build your iPhone app, and you can release an Android app too (maybe). Since then, Android has become the dominant platform, and although many people simply choose to ignore that, I’m pretty sure Appcelerator has improved Android support quite a bit. I also used to hate the proprietary nature of the platform, and although its certainly not a “standard”, they’re open source now, so I can’t get all that upset about it. I expect a good number of internal corporate apps to be built this way. you can sacrifice a little “pretty” for functional. Same thing that drove the endless Visual Basic and Java Swing that scar our corporate intranet landscape. As a platform for consumer facing apps, I’m less convinced that Appcelerator will be huge. I’m sure there will be plenty of it out there, but I’d be shocked if it suddenly swung the needle the other way.
Also, again I haven’t used it, but I would bet the apps are modeled much closer to iOS than Android. As such, it would be Back Button Bingo.
One of the biggest assumptions when talking about cross platform apps is, if you can get it to work, you get 2 for the price of 1. We’ll ignore Windows Phone for now. Although PhoneGap technically supports it, I wouldn’t even try doing an XP app on WP right now. Anyway, the problem, of course, is that writing a cross platform app takes longer than writing a single native one, assuming you have comparable experience on your platform of choice. So, the “1” in “2 for 1” isn’t actually “1”. Its more. How much? Depends. I can’t really say, but its significant, and will vary based on complexity of the app.
The other problem is, you don’t really get “2”. While you could convince me that you’ve written a passable XP app that works on iOS and Android, I will eat my hat if you show me an XP app that’s as good ON BOTH PLATFORMS as it would have been if written in native on each (disclaimer: I have no hat). The “2” isn’t really “2”, if you value design and UX at all. Maybe your demand is fixed, so unless your app simply doesn’t work, you’ll have the same user base. Then, of course, that “2” is pretty much “2” regardless. However, if like pretty much every consumer product, design and UX matter, you need to subtract some because your app isn’t going to be as clean, fast, etc. Its just not.
I seriously need to reorg and edit this, but you get the idea. You can write your app in HTML5, but it won’t be pleasant. And as far as HTML5 taking over the app world, don’t hold your breath.