Trifork Blog

Axon Framework, DDD, Microservices

Firefox OS at GOTO Amsterdam 2013

October 7th, 2013 by
|

FirefoxOS.2I attended the GOTO Amsterdam 2013 conference at the Beurs van Berlage. A nice coincidence happened to me while being there: I attended a talk which heavily promoted Firefox OS as a platform for mobile HTML5 development. Next thing I know, I win a Firefox OS phone at a trivia organized at a completely different talk!

To give you some background, Firefox OS allows you to build mobile applications using web technology (HTML, CSS and Javascript). There are already web standards, or about-to-be standards which allow a web app to access device specific functionality. For example, reading the orientation of the phone (http://dev.w3.org/geo/api/spec-source-orientation.html). The OS exposes many of these standards, so that an app developer can code features in Javascript which would be normally implemented using native code.

Sergi Mansilla, the speaker, said that Firefox OS (and phones supporting it) is not conceived for profit, but only as an “ambassador” to disseminate the idea and motivate big phone and mobile OS manufacturers to adopt the standards. Anyway, I learn now that models running Firefox OS are actually finding a space in the low-end phone market.

Here’s the back of the phone that I won:

IMAG0208

I wanted to test this idea of a web based app leveraging powerful APIs; and since I know a little bit of WebGL, I decided to write an app with some 3D animation.

Well, “write” is a big word: I found this nice project called Rubik3, where someone implemented a rubik cube game in a web page, and I adapted it to run inside a phone. Starting from an existing project spared me all the geometry calculations involved in modeling the cube, and I only had to:

  • change the rendering method to make use of WebGL (luckily, a single configuration change)
  • add support for touch events, along with mouse events
  • make the look of the cube a bit more interesting, with shadows and shininess, to better enjoy the 3D graphics.

The result is a page published on http://ginaluca.github.io/examples/rubik-webgl.html, that you can open (and use) from your desktop or your phone, provided that they support webGL. Otherwise you can try the canvas-based version, to get an idea of what I’m talking about.
Here is how the WebGL version looks like on the Firefox OS phone:

IMAG0206

The animation is actually slow on the phone; I’m probably doing things a bit naively, using Javascript too heavily instead of exploiting the GPU. But still, it was a satisfaction to see it come to life on the device! Have a look at the code if you are curious about the internals.

I wish good luck to this mobile concept, waiting to see if it gets traction. And thanks to the conference to put me into contacts with these ideas!

Comments are closed.