APIs, Firefox OS, and a Chance to Win a Free Phone

The Firefox OS (FFOS) is an exciting and innovative new product that presents consumers and mobile workers with new choices and options. Its application development model which revolves around HTML5, JavaScript, CSS and other open Web standards presents a relatively low bar for application developers targeting the platform. While this low tech barrier is great for those building a mobile Web app, those creating rich mobile applications for other OSes still have their work cut out for them. In fact, adding support for FFOS can complicate matters, forcing devs to write additional code to take advantage of this new mobile platform in addition to the others they are already supporting. What can developers do if they want to build apps for Mozilla’s new OS without forking their code or adding duplicate logic?

One solution which was discussed by Gustaf Nilsson Kotte at Nordic APIs, Stockholm last month is the use of HTML hypermedia APIs coupled with adaptive Web design. You can watch his presentation on YouTube, but here’s the tl;dw version:

  • The number of device types and mobile OSes will only increase (a la FFOS).
  • Users require a great experience regardless of their device choice, forcing app developers to cater to all tastes and options.
  • Because all the UI and presentation code for these different mobile platforms is invariably different, it should be pulled back to the server where it can be reused across OSes and devices.
  • This logic should be made available to the mobile apps across platforms as hypermedia APIs using HTML as the media type (as opposed to JSON).
  • The HTML can be written to adapt based on the capabilities of the device, progressively enhancing depending on what the device supports.
  • For FFOS (and others), displaying the output of such an API yields a mobile Web app that can be rendered w/ the system browser. Using progressive enhancement techniques common on the modern Web, the API’s HTML output can upgrade or downgrade as needed to provide the best user experience possible.
  • When building a native mobile app, the API’s HTML output can be parsed using the DOM; HTML controls, styles, etc. can be turned into native equivalents. This conversion can be limited to screens that are used most frequently while leaving lesser used parts of the app as HTML that are rendered w/ a WebView control.

This idea stirred up a lot of discussion, and people were white-boarding things during the breaks. The sparks of innovation were flying, and it was great to experience!

The conversation continued in Copenhagen where Ronnie Mitra of Layer 7 discussed his experiences building hypermedia APIs and consuming those from apps. He talked about some of the challenges and benefits of this design style, and pointed out that the choice of API architecture should be driven by the end developer experience that is desired. Gustaf’s colleague, Mads Enevoldsen, also delved into this topic, presenting attendees with the maturity model that services must go through if they want to follow the HATEOAS architecture.

Given the relevance to FOSS development and the work that Telenor Comoyo is doing, I’m sure it will also come up in Trondheim, Norway where we’ll be meeting on June 11. I’ve heard from Sune Jakobsson that Comoyo will have some demos available during the networking time prior to the talks, so plan on coming early. That day, you’ll also have the chance to hear from Intel, Telefonica, TwoboDopter, and others about developing APIs for the telecom industry. You’ll also have the opportunity to win a free Firefox phone. Comoyo will be giving away a free Keon and Peak Firefox phone!

Till then, join the on-going conversation that’s taking place on Twitter, sign up for the Trondheim event, and join the Nordic APIs community.