OS aiming to “make the web work for millions on mobile”
Firefox OS is Mozilla’s new mobile platform. The company has argued the rise of HTML5 on mobile is inevitable and Firefox OS is, according to Mozilla Developer Evangelist Christian Heilmann, designed to “make the web work for millions of new people on mobile devices”.
Developer preview devices, identical to hardware that will later ship to consumers (bar some diagnostic add-ons in software), rapidly sold out recently, highlighting demand among developers.
Mozilla sent .net a device, and, with Heilmann’s help, we’ve compiled a list of ten things developers need to know about Firefox OS when working with the platform.1. Firefox OS is not iOS or Android
It would be easy to compare Firefox OS to Android or iOS, but Heilmann reckons that’s only relevant in markets where there’s a comparable hardware offering. He says although you can get cheap Android devices in emerging markets, they’re often generations behind, lack security updates and only have the stock browser. By contrast, Firefox OS is designed to “give you the HTML5 functionality you want—it’s finally the platform HTML5 deserves”. However, direct comparisons with iPhones or flagship Android devices are like “comparing a Formula 1 car with a Range Rover—of course the more powerful one will be faster”.2. Firefox OS is primarily designed for emerging markets
Instead of being designed as an alternative to Android or iOS, Firefox OS and partner hardware is designed as a replacement for feature-phones. “The main idea is to get people who only have access to SMS messages and Snake into the world of HTML5 apps and Cut The Rope, but without breaking the bank,” says Heilmann. A key differentiator is a credit card not being needed, with charges optionally going to the telephone bill or a pre-paid SIM.
This direction also impacts on other aspects of Firefox OS…3. Firefox OS hardware is not cutting edge
Using the developer hardware will for many be like stepping back in time. The screen isn’t very sharp and often needs very firm presses to get a response; also, it sometimes feels sluggish. Heilmann argues this should be a wake-up call for the web industry: “The problem with web developers is they’re all on cutting-edge hardware but users aren’t. We’re getting lazy, with our tools being so good we don’t feel the pain of our end users. I’d rather build something on a low-spec device that will scale up to ‘infinity’ and be screaming fast than target an iPhone and hope it works elsewhere.”
With Firefox OS likely to be the first impression millions of people have of the internet, making your app perform well is of paramount importance. As Heilmann says: “Making it so people can perform the tasks they need to is more important than using the newest, coolest 3D transformations.” The Firefox simulator can assist with such optimisation, logging dropped frames, providing insight into what’s happening at any given moment.4. Firefox OS is not a new ecosystem
Although Firefox OS is a new platform, Mozilla nonetheless doesn’t consider it a “competitive new platform,” but a case of “moving the mobile web into the world where it’s supposed to go”. The distinction is subtle but important, with the long game being widespread use of an HTML5-based platform (thereby working with existing websites) where options you’d previously have only gotten through the likes of PhoneGap are available directly within the operating system itself; this also comes without the hindrance of a web view that has limited performance and no access to accelerated hardware.5. Firefox OS enables full access to a device’s features
When the first iPhone arrived, there was no SDK. Apple pushed web apps, but, crucially, much hardware was off limits to HTML5 websites. With Firefox OS, you get access to the camera, accelerometer and all the other things that make a mobile device interesting from a development standpoint. For example, there are APIs for accessing the proximity sensor, battery status and ambient light sensor, the last of those potentially enabling interfaces to adjust for lighting conditions. Everything is implemented as open-standards proposals, which other browsers can use and integrate.6. Firefox OS is relatively simple to create and rework content for
Everything on Firefox OS is built on web standards, meaning if you can create an HTML5 website, you can build for Firefox OS. The approach Heilmann suggests is akin to adaptive design: “We encourage people to not write just for Firefox OS, but make apps that run everywhere. With the special features others don’t yet give you, wrap them in an 'if' statement and be happy.”
Often, content can be reworked easily. Heilmann says WebOS 'refugees' are discovering apps initially designed for that system can be switched to Firefox OS with just a few lines of code. More generally, he recommends working with the hardware and the things HTML5 gives you, such as touch instead of click, and ‘translate’ instead of ‘top-left’ for positioning, to trigger hardware acceleration.7. Firefox OS has a dynamic app search
The Firefox OS dynamic app search indexes apps on the device, in the Firefox Marketplace and also online. When wanting to perform an action, instead of finding a specific site or going through an app discover/install/review cycle, you instead choose from results relating to a specific, focussed query. The options provided then effectively act as trials that can later be added to your home screen.
Heilmann thinks this is a good excuse for developers to brush up HTML5 sites that have languished since the days of the original iPhone: “They give the ‘mobile web’ a bad reputation, but now we’ve a new platform with millions of people untainted by the functionality of Android and iOS. They just want to get online and do stuff without installing huge apps and updates. The dynamic app search gives them this in seconds, and your website becomes the advertisement and demo for your app. There are no doorslams, and there’s little for developers to do—just put your manifest file there and ensure your site works in the resolutions Firefox OS phones have.”8. Firefox OS emphasises user control
Web Activities within Firefox OS provide the means for full feedback loops, enabling applications to delegate an activity to another (usually user-chosen) application. But Heilmann notes you don’t need a packaged Marketplace app to access things like the camera. You can just ask the user for a picture and the phone will ask them to go to the Camera app and take a picture; they’ll then be returned to the original app, along with their image. Heilmann adds this also works on Android: “This goes back to Fruyo, and so old Android phones become useful again if you install Firefox!” However, it requires development effort—you can’t expect everything to work automatically; for example, during testing, we found various social apps didn’t yet play nicely with the Firefox OS camera.9. Firefox OS is there to make people money
Mozilla itself is not-for-profit, but the company wants people and partners to profit from the system. Heilmann also reckons it’s a great opportunity for app-developers unable to afford iOS or Android devices or who cannot sign-up to US-based developer agreements.
In terms of the Firefox Marketplace (the simplest means to monetise an app on the platform), it works on a standard 70/30 split and apps are reviewed for security and illegal content, but developers can utilise various providers for billing, do their own billing, or even create their own marketplace, given that the entire thing’s built on an API.10. Firefox OS aims to reframe the open web on mobile
Mozilla’s mission is to “promote openness, innovation and opportunity on the web”. Firefox OS is simply another component of that, with relevent research feeding into Firefox on other platforms, and available for other parties to utilise if they wish.
Heilmann hopes Firefox OS will give HTML5 a boost: "It's getting a bit stale, with us having been promised so many features from various platforms but never having got them”. He believes Firefox OS provides “the chance to show on one platform with millions of new users that this can be done”. He also hopes others will follow suit and that more open-source phones will appear, convincing carriers and mobile providers to be more open. “Some are getting interested in HTML5 because they’re tired of being locked out from marketplaces,” explains Heilmann. “With our partnerships, we’ve shared our vision with partners, and got them on board from an engineering perspective. Although there were discussions to be had regarding carrier apps, people realised simplicity rules in markets where connectivity is slow and people care about every megabyte. It’s exciting to go into a market and say open can work and it can be a massive differentiator for providers, users and developers.”