text post 11/13/2012

Mobile Web Unity

Fragmentation across mobile devices has been plaguing developers since mobile devices first started to become important. Made a successful iPhone app? Welp, better make an android version too, which means your app has to be totally gutted and re-coded in another language. Made a nice web service? Better make an app for it, so people will use it on their phones. Actually, make that 2 apps, one for iOS and one for Android. And probably a mobile website too.

When it comes to testing mobile sites and apps, it’s a whole different level of pain. Made an iPhone app? It’d better work on the iPad too. Oh, and the iPad mini too. And make sure you test on iOS 5 and 6, since their maps suck now and nobody upgraded. Then when you branch out to Android, you’d better test it on the ~100 different models and sizes of phones on the market, not to mention like 5 different OS versions.

Why does this have to be so painful? Why so many languages? And it’s so difficult to deal with the number of screen sizes and vendor-specific tweaks… if you’re just starting out, it’s like looking up from the bottom of the grand canyon. Shouldn’t we be able to code in one language, a language that’s designed for visual responsiveness? It’s the developer’s ideal - write once, deploy everywhere. But that doesn’t exist for mobile… does it?

It totally does. It’s html, css, and javascript. And we’ve been coding with these languages for years. Html5 introduced a number of excellent helpers for this exact purpose as well. Flexbox positioning. Media queries. Video and audio APIs. Sure, it may be newer and not ‘fully released’, but html5 has been widely in use on the web for years. It is the ideal language for creating visual interfaces on mobile devices, and is the only language that could work everywhere.

Currently, you can build ‘mobile web apps’ for both ios and android, but not much energy has been put in by google or apple to make them fantastic experiences. They have remained focused on their native SDKs - the majority of apps are there already, and it’s how they make their money (by taking a cut of purchases through the app store). But I feel like we can do better. Right now, there are shadows of capabilities that a mobile web app could have in iOS. You can add a mobile site to your home screen, and provide it with an app icon. You can specify a splash screen (although not one for retina) that comes up while it loads. You can get up to 10mb of local storage on the device from a website. You can access the accelerometer, gps, and as of iOS6, the file system and camera, straight from a web app. It’s absolutely possible that web apps could be first class citizens on mobile devices - they are just harder to control for vendors, because the web is open.

Peering long and hard into the distance, I can see a future where mobile apps are unified, and learning how to build them is easy. Where a full hardware api is available through javascript. Where rendering is consistent, and hardware acceleration can be triggered with css. Where your desktop web app can be the same site as your mobile app. Where the html5 offline api is available for use in mobile web apps, so they don’t differ at all from native apps.

It may be a long way off, but it’s far from impossible. We could have an easier and more open environment for mobile apps. Vendors could still set up a store and accept payments for app installs. And most importantly, the mobile app ecosystem would thrive with the energy of millions of developers and companies whose lives are so much easier, because the mobile web has finally been unified under simple and open standards. But for now, it’s still just a dream…