Site icon Mollejuo AR Studio

AR with HTML5

HTML5_LogoThe computing industry is trying to make HTML5 THE standard, specially for the mobile world. And why not? The dream under HTML5 is write once deploy everywhere, a dream started by Sun with Java, we all know where that stands.

Native vs. Web

There has been a long debate on whether to take the native approach or the web one (HTML). To summarize, native code uses the set of instructions and tools meant to an specific platform, where as HTML, uses only text in HTML code. The main difference between the two is performance and ease of development. Depending on who you ask, they will tell you this is better tun the other one. Native is -obviously- more efficient as it uses mobile devices resources carefully. However, the development has to be specific for each platform aimed to be covered. Naturally, this approach is the correct one, as long as cost is not factored in.

By its part, HTML 5 doesn’t have this direct control of the native system resources (at least that easily nor flexible), but the deployment can be made once and then tweaked for other platforms. In theory this approach means lower cost, but it will the depend on the complexity of the app itself.

By our part, we took a hybrid approach. For iOS and Android, our apps are developed native. For Windows Phone, Blackberry, FireFox & Chrome, they all use the same Webapp. While the information displayed on the two approaches is the same, the way is being displayed is quite different: AR is used in iOS & Android, while AR is not used in the other platforms.

AR in HTML5

As we have explained before, for AR to work it needs to access several of the devices sensors like: magnetometer, gyroscopes, accelerometer, etc. The only way to have direct access to these sensors was to use the native approach. Yes, a web browser have also access to these sensors, but it adds a layer to build on top of. This layer adds flexibility, as the development concentrates in HTML5, the penalty is in performance. Thus something like geolocated AR while technically possible in HTML5, wasn’t practical due to mobile devices computing power limitations.

But that was years ago.

When FireFox OS came out, we were really fascinated and intrigued by it. FireFox OS only supports Web apps (based on HTML5), something like AR entered the domain limitations previously described.

Thankfully Moore’s Law is still around (although not for long, it seems). Mobile computing power has increased enough lately that AR is now a reality within a Web browser with little penalty (if any) in performance. Just six month ago, FireFox made a demo of building an AR app based in HTML5, now there are several of these demos being developed.

Could this reduce the need of AR browsers? Not yet, as they move towards wearables (Google Glass and stuff), as these ones, due to their tiny size, have old specs hardware, which in turn require native code, at least for the moment.

Exit mobile version