Presentation: If Mobiles Don't Come to the Web, the Web Must Come to Mobiles
There is a lot of work in the making about keeping the mobile web open and luring users away from the siren song of closed environments. A lot of the problems the web has on mobile devices is that the hardware is not available to us using web technologies. This is changing. Google, Microsoft and Mozilla are all working on making it possible to write apps and web sites in the same open technologies and with the web APIs and Boot to Gecko we have access to the things that make phones fun without having to resort to writing native code. In this talk Chris Heilmann will show what is already possible and where you can help to keep the mobile web open and allow for innovation.
Christian Heilmann, Over the Air, Bletchley Park, England, June 2012
I don't know about you, but I really think that what made me a developer in later life was having Lego as a kid. I inherited a random box of lego bricks from my older siblings and went nuts with them. I built all kind of things.
This is an ad from the 80s showing a kid with Lego bricks stating "what it is, is beautiful" although it is just a random assortment of bricks. This is how Lego worked for me - the random brick construct was a ship, a dragon, a spacecraft - whatever I wanted it to be.
When Lego evolved things got more exciting. We had cogs, springs, even electric motors to build even cooler models. We could build things that were interactive and moved on their own accord.
Then lego got even more specialised and you got smooth and large components rather than bricks. This made for sturdier toys, but it also meant that they weren't as extensible as they were before. They also were more limiting - a car was a car and it was harder to make it into a dragon.
These days, Lego is branded and there is a new sub-brand every few months, most of the time aligned with some movie release. This makes them toys, but also limits the imagination and makes them rigid and not extensible products that can be what you want them to be. In other words, they are much more time-bound than they were before.
With the move to mobile environments, connectivity was a much bigger issue than it was before. People get much more annoyed when things are slow on phones than on desktops - probably because of the lack of multitasking in the early stages.
What we needed was to make the web technologies better to allow for all the issues we have to work around. We needed ways to create graphics on the fly, local storage, offline storage, native video and audio and all the things that allow for apps to be engaging whilst not killing the hardware.
But what was really the main idea was to have apps as a way to sell both hardware and the software as products. Apps are self-contained to make it easier for the user but also to make it much easier to sell products quickly and a lot of them. This is not about technology, really. It is about consumption.
App markets with closed environments are also very interesting for those who want to protect their content and call the shots. When talking to business people about HTML5 and the open web the most requested information is about stopping people from downloading content. Closed tech can claim this is impossible which is really interesting for partners.
Staying in a closed environment is safe. You don't get wet, cold or get germs from other people. In development, you call the shots and you also build a superb product when you have a defined hardware and software. Products that are closed and do one thing well can be easily sold. There is no confusion as to what they are and their limited nature is known. A native app on phones is that. You know the tech, you abide the rules and you deliver a quick product.
When the press comes to Android it is always quick to mention the fear and confusion of fragmentation. Of course it is annoying that an "Android phone" could be anything and there is no one performance. But this is the same with iOS if you think about it - a first generation iPhone won't be too happy with a lot of the new apps. When Lion came out a lot of my apps stopped working. Fragmentation could also be seen as choice and reaching more users.
An open approach allows you to make something more out of several parts. You can easily accessorise and add to a core product to make it more interesting or to cater it to different needs. In the case of apps this could be simpler updates and extensions. Web developers have worked like that for years. Fragmentation is what we expect and plan for. This makes it not scary at all.
However, there is no need for specialisation and branding when you are ready to put some effort in. This is a remote controlled Land Rover made from original Lego parts. It functions perfectly, it has all the suspension, gear and engine functionality of the original car. What this means is that someone was geeky enough to put the effort in and the result is breathtaking.
It would be arrogant and outright wrong to say that HTML5 is ready to take on native apps face to face right now. A lot of the technologies are slightly broken and one of the bricks not working can be fatal to a project. The main issue, however, is that fixing a lot of the problems is not really in the best interest of those who run native app stores. So it is up to us to fix them.
Being open means that a lot of people can help you fix and enhance your products. Lego knows that, too. Whilst playing the specialisation and branding game they also have Cuusoo, a project that allows people to come up with new products and, when they get enough votes, build them. In our case we can now use HTML5 and have our cake if we use build tools like Phonegap, Adobe Cordova or Mosync. These translate to native code and give us the needed APIs to access the hardware. Libraries are another way to work around differences in browsers.
That is not enough though. To make the mobile web work we need access to the hardware. The first step that Mozilla took to bringing back the web to phones was the Web APIs. With these standards which are implemented in a few browsers and are openly worked on by a few companies you can access the battery, the vibration API, you can send SMS and you can access the camera. With IndexDB you can also store data on a phone in a more mature and performant way than with localStorage. With hardware accelerated canvas and webgl and requestAnimationFrame not running animations when a tab is not active and only when the hardware can animate you have a much faster experience and you don't kill the battery of a phone.
Firefox came out to battle Microsoft Internet Explorer as the only browser out there. I am 100% sure that the web of today would not look the way it does and standards wouldn't have come as far if that hadn't happened. Now we do the same with Firefox for Android. Codenamed Fennec you can and should download it now from the App store. It beats the local browser in many ways when it comes to supporting CSS3 and HTML5. You might also realise that a Fennec has much bigger ears than a mouth which means it listens more than it makes noise. So please, tell Fennec when something is wrong by filing a bug as we want this browser to be your browser much like Firefox was and is a browser for you and not for stakeholders in a company.
The next step in making the mobile web work is offering a shop front that allows HTML5 apps to reach end users and be sold. The Mozilla Web Store is that shop. Apps written for it are meant to run on any HTML5 capable browser and it is its job to bring monetisation to HTML5. Not an easy task, but we need you to give us apps to show. Incidently I chose this image as it is a news agent in my neighbourhood who prides himself of being "porn free". In a long legal battle it refused to stack adult magazines although all news agents are meant to do so in the contract with magazine providers. The shop owner took a stand and won and became more famous than other news agents that way.
This morning you might have seen Telefonica show the open web device and how it will bring smartphones to a market that can only afford feature phones. Boot2Gecko is the engine that powers this phone and it is Firefox using the Web APIs running on a Linux core - there is no proprietary code in there at all. With Boot to Gecko we can build phones and interfaces that we can only dream of yet, as it is all open bricks that mesh with each other.
Even if you don't care about Firefox or B2G, I want you to help us with one thing that keeps the mobile web back like nothing else: the monoculture of WebKit and the wrong perception that there is one engine to rule them all. You can do this twofold: tell us, Opera or Microsoft about sites that don't work in their respective browsers so we can see what is the issue and - most important of all - do not write webkit specific code without fallbacks or do flaky browser sniffing to block out users. This was a mistake in 1999 and it is still one now.
I think it is unfair of us to rob the next generation of web users of the chance to be a maker and to tinker with the web instead of just consuming it. Sure, there are learning apps and some apps are creative, but there is nothing that matches the happiness you can see in a new developer when they change a few settings and get something new. Mozilla has quite a few projects to promote web literacy and others targeted at kids to start using web standards. Take a look at Mozilla Thimble and the mozparty coming this summer.
Last but not least, our door is open. If you want to drop by in Covent Garden to have a drink, use our Wifi and a silent meeting room, just drop by. Our office is an open sharing space and there are people working on Fennec and lots of other interesting projects there.