Abstract:
When the web was defined as an idea it was based on the principle of independence of hardware, global location, prosperity or ability. This changed drastically when the mobile web came around and we got sucked into a world of software dependent on certain hardware and global location. HTML5 and the mobile web based on open technologies became something that needed conversion to native code to access the new hardware people use. This is against the main principle of the web and means we duplicate efforts all over the place. In this talk Chris Heilmann shows how Mozilla is battling this trend and how brushing up your HTML5 solutions allows you to reach millions of new users forgotten by native technology but nevertheless eager to be online.
When I was a kid, I had an uncle in America and he sent us comic books. One of the things advertised in these comic books were sea monkeys â awesome pets that are a whole society and play with another and anyone can look after. Turns out these things are just Brine Shrimp and donât look at all like that. Actually they are really ugly and boring.
This is what I feel a bit like when we look at what happened to HTML5 on mobile devices. When the iPhone came out Steve Jobs announced that there is no need for an SDK and that Safari with web technologies is more than enough to deliver great experiences. When I tried though what worked I quickly found myself hindered in a lot of respects and the attitude of Apple towards web technologies on the phone vs. native apps changed drastically and very quickly.
And somehow this lead to a terrible experience of the web on mobile devices. This is especially annoying when the sites have been âoptimised for mobile viewingâ and still fail to deliver anything useful. Another big thing that is happening right now is web sites redirecting you to download a native app instead. This is not what I want when I am on the go on a limited connection and simply look something up. Brad Frost collects a lot of terrible user experiences on mobile at wtfmobileweb.com.
What happened? When did we give up on the idea of nice and responsive web products that use what is available to them? It can not be about the tools we have. Browsers have amazing developer tools built into them these days â all of them, really. Using these tools we have very fine-grained control over what happens in a browser.
For example in this shot you can see the difference using requestAnimationFrame instead of setTimeout makes.
Letâs not forget how far browsers have come in the recent years.
Browsers these days are nothing more but awesome. Whatever you can complain about you can file as a bug and if it is a real issue it can be fixed within weeks. Every few weeks there are browser updates and security fixed happen over night. All of them render HTML the same way.
And yet the web is full of sites that are plain broken on different devices. Simple things like forgetting to define a viewport size can make an interface unusable or really annoying to get around. Why?
I think as a community we get far too excited about products. The whole mobile space thrives on hardware sales. So instead of building stable and good solutions we continuously want the newest and coolest and support it exclusively. I remember when Retina displays came out and many voices in the web design community called out that we need to fundamentally change what we are doing now. This is fleeting, and in many cases we arenât even allowed as web developers to access the new technology that makes a product what it is. You can look very silly, very quickly when chasing the shiny.
One big part of this was people getting too excited about the iPhone and Android as the only platforms to support prematurely calling WebKit the only browser engine worthy of our efforts (effectively repeating the same mistakes we did in the end 90ies which gave us all the fun âIE onlyâ web products). With the announcement of the Blink rendering engine powering Opera and Chrome from here on forward the âwebkit onlyâ argument went down the drain. Good riddance.
How about we give web technologies a new platform on mobile devices? And how about not trying to compete with iOS and Android on high end devices while doing so? This is what Firefox OS is about â it brings the web to people who have mobiles as their main interaction with the web â based on web technologies and without the lock-out.
Here are the main differences that FirefoxOS bring in comparison to Android or iOS:
Targeted at new, emerging markets
Very affordable hardware
No credit card needed â client billing
Web technologies through and through
18 mobile partners, 4 hardware partners
Firefox OS was created to bring users of feature phones into the web-enabled mobile world. It is meant to cater to the markets not covered by iOS and Android. Yes, you can buy cheap Androids world-wide but the version of Android they support doesnât have an out-of-the-box browser that allows you to do interesting things on the web. Much like Firefox and Opera for Android allow more users world-wide to have a great web experience without having the latest hardware, Firefox OS goes further. Its main goal is to bring millions of new users to the web on their mobile devices without getting a second-grade experience.
One huge differentiator of Firefox OS is that instead of solely relying on a market place to list apps, apps can be found by entering what you are looking for. This means that if you enter for example a band name like âu2â, you get music apps offered to you. For a movie title it is apps that have to do with films. These are both apps listed in the market place and web-optimised sites. Say you looked for a band, you could click on the songkick icon and get the mobile interface of songkick. You can try the app before you download it and see if you like it. If you want to install it you just tap it for longer and Firefox OS will install the app â including offline functionality, full-screen interface and the extra hardware access Firefox OS offers. This means your mobile interfaces become the ad for your application and users donât need to download and install a huge app just to try it out. Everybody wins. We made App discovery as easy as surfing the web.
What makes your HTML5 site and app for Firefox OS is the manifest file:
{"name":"My App","description":"My elevator pitch goes here","launch_path":"/","icons":{"128":"/img/icon-128.png"},"developer":{"name":"Your name or organization","url":"http://your-homepage-here.org"}}
{
"name": "My App",
"description": "My elevator pitch goes here",
"launch_path": "/",
"icons": { "128": "/img/icon-128.png" },
"developer": {
"name": "Your name or organization",
"url": "http://your-homepage-here.org"
}
}
In it you define the name, describe the app, give us info about yourself and which icons to display. You also define the localisations that are available and what access you need to the hardware. Depending on how many things you want to access, you can host the app yourself or you have to get it hosted through our infrastructure. This is a crucial part of keeping the platform secure. We can not just allow any app to make phone calls for example without the user initiating them.
These are the three levels of apps available in Firefox OS. For third party app developers, the first two are the most interesting.
Hosted apps â stored on your server, easy to upgrade, limited access.
Privileged apps â reviewed by the App store, uses a Content Security Policy, hosted on trusted server
Certified apps â part of the OS, only by Mozilla and partners
Apps that run on your own server have all the access HTML5 gives them (local storage via IndexedDB, offline storage via AppCache) and the new WebAPIs defined by Mozilla and proposed as a standard. A few of these APIs are also available across other browsers, for example the Mouselock API or the Battery API.
Vibration API
Screen Orientation
Geolocation API
Mouse Lock API
Open WebApps
Network Information API
Battery Status API
Alarm API
Push Notifications API
WebFM API / FMRadio
WebPayment
IndexedDB
Ambient light sensor
Proximity sensor
Notification
One very important API in this stack is the Open Web Apps API. With these few lines of code you can turn any HTML5 web app into a Firefox OS app by offering a link or button to install it. No need to go through the marketplace at all â you can be in full control of your app.
var installapp = navigator.mozApps.install(manifestURL);
installapp.onsuccess=function(data){// App is installed};
installapp.onerror=function(){// App wasn't installed, info is in // installapp.error.name};
var installapp = navigator.mozApps.install(manifestURL);
installapp.onsuccess = function(data) {
// App is installed
};
installapp.onerror = function() {
// App wasn't installed, info is in
// installapp.error.name
};
All the APIs are kept simple, they have a few properties you can reda out and fire events when there are changes in their values. If you used jQuery, you should be very familiar with this approach. This code, showing the Battery API should not be black magic.
If you host your app in the Mozilla Marketplace your app can do more than just the APIs listed earlier. You can for example access the address book, store data on the deviceâs SD card, connect via TCP Sockets or call third party APIs with XHR.
Device Storage API
Browser API
TCP Socket API
Contacts API
systemXHR
For a hosted, privileged app it is simple to create a new contact. That enables you for example to sync address books across services. As with all the other APIs, you get an event handler that gets fired on success or failure.
var contact = new mozContact();
contact.init({name: "Christian"});
var request = navigator.mozContacts.save(contact);
request.onsuccess = function() {
// contact generated
};
request.onerror = function() {
// contact generation failed
};
Certified apps â apps built by Mozilla and partners have full access to the hardware and can do everything on it, including calls and text messaging and reading and writing permissions as well as accessing the camera.
WebTelephony
WebSMS
Idle API
Settings API
Power Management API
Mobile Connection API
WiFi Information API
WebBluetooth
Permissions API
Network Stats API
Camera API
Time/Clock API
Attention screen
Voicemail
One question we get a lot is why hosted apps on your own server couldnât get full access to the camera and the phone â something that always is an annoyance on iOS which is why we need to use something like phonegap to create native code from our HTML5 solutions. The reason is security. We can not just allow random code not in our control to access these devices without the user knowingly allowing it every time you want to access this functionality.
If however, you are fine for the user to initiate the access, then there is a way using web activities. This for example is the result of asking for a picture:
The user gets an interface that allows access to the gallery, the wallpaper or to the camera. Once a photo is picked from any of those, the data goes back to your app. In other words, web activities allow you to interact with the native apps built into the OS for the purpose of storing, creating and manipulating a certain type of data. Instead of just sending the user to the other app you have a full feedback loop once the activity was successfully done, or cancelled. This is similar to intents on Android or pseudo URL protocols on iOS, with the difference that the user gets back to your app automatically.
There are many predefined Web Actitivies allowing you to talk to native apps. All of these are also proposals for standardisation.
configure
costcontrol
dial
open
pick
record
save-bookmark
share
view
new, f.e type: âwebsms/smsâ or âwebcontacts/contactâ
For example this is all the code needed to send a phone number to the hardware. For the user it would switch to the dialer app and they have to initiate the call. Once the call is hung up (or could not be connected) the user gets back to your app with information on the call (duration, and the like).
var call =new MozActivity({
name:"dial",
data:{
number:"+1804100100"}});
var call = new MozActivity({
name: "dial",
data: {
number: "+1804100100"
}
});
To get a picture from the phone you initiate the pick activity and specify an image MIME type. This offers the user all the apps that store and manipulate images â including the camera â to choose.
var getphoto =new MozActivity({
name:"pick",
data:{
type:["image/png","image/jpg","image/jpeg"]}});
var getphoto = new MozActivity({
name: "pick",
data: {
type: ["image/png", "image/jpg", "image/jpeg"]
}
});
Again, a simple event handler gets you the image as a data blob and you can play with it in your app.
getphoto.onsuccess = function () {
var img = document.createElement("img");
if (this.result.blob.type.indexOf("image") != -1) {
img.src = window.URL.createObjectURL(this.result.blob);
}
};
getphoto.onerror = function () { // error
};
The great news is that if you have Firefox on Android, this functionality is also available outside of Firefox OS for you â any Android device will do.
I hope you are as excited as we are and you are ready to have a go at playing with these APIs and Activities. But where to start?
The Firefox OS Developer Hub is the one-stop-shop for everything Firefox OS. There you can find information on what makes a good HTML5 app, play and download example apps to change into yours and find information how to submit your app to the marketplace or how to publish it yourself. You also get information about monetisation and how to set up a development environment (basically installing the simulator).
The simplest way to test out Firefox OS is to install the Simulator, which is just an add-on for Firefox. Once installed you can test your apps on your server or on your local hard-drive in a Firefox OS instance running in an own thread and an own window. You can get all kind of feedback about your app working in Firefox OS with the developer console and the error logs.
Firefox OS Boilerplate is a demo app that has stub code for all the different Web Activities. You can try them out that way and just delete the ones you donât need. It is a great demo app to get started with and base your efforts on.
Sooner or later youâd want to test your app on a real device though. The easiest way to do that is to get a developer phone from Geeksphone.com. These have the same specifications as the Firefox OS phones sold in the markets our partners are targeting. These are now ready for pre-order and the shop should be live soon.
Even if you donât care for Firefox OS or donât want to build something for it, rest assured that it will have an impact on the current mobile web. A whole new group of users will emerge and the mobile version of your site will become a calling card for them to get interested in your offers. And if anything, HTML5 is supported by every player in the market, so now is a good time to brush up what is out there. This is what Firefox OS brings you â and soon:
A whole new audience
HTML5 without the lock-out
Your web site is your ad!
Minimal extra work, it works across platforms
Posted in General | Comments Off on Making your HTML5 efforts worthwhile â #sotb3 talk
âSetting disruptors to stunâ was the keynote at HTML5 Devcon in San Francisco in April 2013. In it, I am explaining why we can not directly compare native and web apps and that the technical differences are not really the main issue. The main problem is that native apps follow a very old principle of âbuilt-in obsolescenceâ which means that they are built to break and be replaced with a newer version so you can sell more. The talk then shows how Firefox OS disrupts that idea with the dynamic app discovery and by going to where new audiences are.
Thanks for coming again. Thanks for being in the grand ballroom. With this chandelier I wouldâve expected people to dress up a bit more nicely, but weâre geeks so I guess that didnât work out. Today I was asked to give an inspiring speech about things and stuff, and I think thatâs a very good start for a day. I wanted to do something very, very technical, but then itâs a keynote so you donât do that, so donât expect that from me. We can talk technical in any way you want to later.
I want to talk about how the web used to be this massive disruptor to a terrible market and how it changed over the years, and how in the last few years, especially last year here, a lot of people started scaring us into thinking the web was not there any more and itâs a new thing that we have to do right now and we are all going to lose our job and be homeless in two months because we donât support the newest coolest iPad. Itâs like this childrenâs book that you can buy now, which is called, âYou canât be an astronaut, itâs just not realistic.â This is really cool to give to your kids, like, âHere you go.â
Back in the days when I started on the web it was like this. We had wired connections and we all had keyboards to surf on. We all had to keep the mouse up, otherwise it would fall off the keyboard. This is what the web was about. It was just beautiful and in nice colors, and every kid had the hat sideways. It was just this wonderfully cool thing.
In reality, it was a really cool thing. I worked as a radio journalist back then, and I saw the Internet as there for everybody to start publishing and for everybody to be found worldwide and to communicate with people worldwide. To me this was a totally new thing. Before that we had these BBSâs where you had to know the telephone number to call to connect and get data from another server worldwide.
Then with the Internet, we connected with modems that sounded a bit like Skrillex but really wasnât. It was just connectivity. You stood there and like, âThis almost looks like an image, just give it another five minutes and itâll be fine.â You had connections where you loaded something and then you disconnected it because you paid per minute, and then you went through the cache to find all the images youâve been downloading because while you where loading it was too slow.
All these were really cool things, but it was a geek thing. The main market basically saw us like that. They saw it like the Ubuntu launch party there. Basically these are the geek guys that just do that and itâs never going to catch on and nobody cares. Old-school programmers like mainframe programmers or people that use Java and things like that, people who have beards and suspenders and are real men, told us that the web will never be anything. âThatâs just a toy. You use that angle bracket stuff thatâs never coding.â
Nowadays itâs a bit different. The web is mainstream and weâre all these cool hipsters. Everybody uses the web for something. Most of the time horrible things, like following Justin Bieber on Twitter and things like that, but everybody uses it and weâre seen as these magical creatures that can build websites and nobody knows what we are doing.
The reason why that blossomed so much in those few years is that itâs built on a principle that anybody can be on the web just with an HTTP connection and something that shows HTML. It doesnât matter where you are, it doesnât matter what your ability is, what your language is, what your connectivity is. Everybody is invited. That was the Olympic Games, the opening, and thatâs when Tim Berners-Lee typed this in and said the web that he invented, or with other people, is for everyone.
Everybody on the web is a consumer and a creator. We keep forgetting that because we are getting into that consumption thing. People get excited, âI can watch Game of Thrones streaming on my Internet.â Youâre like, âHow is that better than TV? You can start and stop it, thatâs just like a VCR.â A streaming video, a streaming TV channel would allow the audience to remix it and to do things with it and to vote on different endings and make it different.
This is what we do in Mozilla with the Webmaker project where we invite kids and journalists and people who are just afraid of computers and not use to the web for anything to start playing with them and start creating. Seeing how empowered they feel when they start creating is just gorgeous, because for a lot of people itâs a totally new job that they couldnât have had before. So good times weâll have.
We have these browsers that get better and better and better. We had a few browsers that finally died and then we had a few browsers that actually agreed on everything. HTML 5 means first and foremost that all browsers run the HTML the same way. That was a big, big thing. We see this as a given now, but actually that white space in Internet Explorer between LI items means you couldnât style them. That was just a very annoying thing. You had to delete all kinds of things in there.
The browsers got better and better and weâre like, âYes, we got it made, we got these cool HTML 5 APIs, we can do something.â Then change happened. Whatâs the main difference between Bill Clintonâs inauguration and Obamaâs inauguration, except for the size of the flag and the color of the president, is everybody has this phone and takes pictures. Really blurry ones, really bad ones but everybody wants to take a picture and put it up online and be the first one to put it online because the 600 other people in that room donât do the same thing, they donât have the same idea.
I love it when you are at concerts and people hold their iPads up and film the band. Youâre like, âYeah, that sound quality is going to be amazing.â I had it the other day at Dropkick Murphys. Iâm like, âDude, last time you wouldnât have survived and your iPod wouldnât have,â but fair enough.
The web came around and the mobile phones came around, the smartphone came around. All hail the hypnophone; everybody has one, everybody needs one. Itâs a great thing. You can talk to your friends who are on the other side of the planet, so you donât have to talk to people next to you because theyâre smelly and they spit and stuff. You have your virtual friends, so you donât need to have real connections with other people, but you can complain online that you donât have any friends. Itâs a very on-the-go market and sometimes you even have connectivity and video with AT&T.
It started well. This is Steve Jobs, the visionary, the really, really good man, a really, really interesting guy. He released the iPhone ⊠well, he had a few people helping him. He released the smartphone and iPhone and the first thing he said, âTo be really disruptive and re-invent the phone, we have to actually have no SDK. Itâs the web, itâs a web-based phone. You have Safari, you have the power of Safari and HTML 5 in your hand. You can build everything on the web with the phone, you can build great applications that can talk to the telephone, can talk to the map application.â Thatâs what he said.
Then the big backlash came from the developers and internally. Why did that happen? Well first of all, the mobile web was this mixed thing that nobody knew whatâs going on there. We had this thing in the middle, and we had web developers on one side and native developers on the other, and both of them wanted to do it.
The native app developer is different to a web developer in many, many ways. They are actually used to a different environment. As a web developer Iâve got not SDK. I use VI, I use sublime text, I use that and we argue for a month whoâs got the better text editor. We donât wait for actually downloading an SDK for it as well.
The mobile space is a competitive and very closed market. The success of companies is very much based off how many patents they have and what they can actually protect from another. Like, âOh, you canât touch the screen of my phone because thatâs my right.â Developers coming from that environment, for them the web seems scary. Like, âEverything is free and you can look at my code?â âHow can I protect my java script code?â is a question I get every single time. Put it on a memory stick; leave it in your desk.
Fragmentation is the next big horror. âOh my God, people have different phones and basically different sizes, and I have to support all of them. If only we had one government issued phone for everybody that has a fixed static thing.â For web developers it was, âYeah, so? This is cool, I can write things for different platforms.â So fragmentation is being this horror word for everybody.
Shouldnât we cherish flexibility much more? Shouldnât we say, âHey, if everybody cannot afford the newest iPhone, they have an old one, why not give them something for an iPhone 4? I mean these are just people with so much hardship in their lives, they only have an iPhone 4, so we should give them something.â
If you think about it, these tablets and smartphones are actually very flexible. Because you see as soon as you tilt them, they get longer. Because nothing at an angle could be as high as the other one, as long as itâs longer. Every display of those ⊠I guess if you have the phone and hold it, it just automatically happens slowly so you donât realize it. So tilting the phone makes it longer, and this is something you care about in your designs as well.
I wondered what the whole backlash was about. Why do developers get so riled up about not having an SDK and actually bringing the web on the phone? I did some research and I found this wonderful website called, âThe Story of Stuff,â which explains about consumption and how America with 1% of the world population creates 20% of the waste and all these kind of interesting things. Itâs a great thing to learn on the web. Itâs in Flash but itâs not evil, so itâs really nice.
I learned about an old, old idea from Victor Lebow in The Journal of Retailing 1955. Actually what they said, and he was one of the advisors of President Eisenhower back then as well, âTo make American companies be successful and make sure that we have money and jobs for the next few years our enormously productive economy demands that we make consumption our way of life, that we convert the buying and use of goods into rituals, that we seek our spiritual satisfaction, our ego satisfaction in consumption. We need things consumed, burned up, replaced and discarded at an ever-accelerating rate.â That was in 1955, itâs called, âThe Principle of Obsolescenceâ and Iâm happy I managed to pronounce that word.
Now as evil minds thing alike, there was this person that a year before even took that further. The build in obsolescence means that products are built to break after a year or two so you buy a new one. You realize that with every brand out there. I remember when I could kick a car door and there wasnât a dent except my foot. Nowadays you have to replace everything and there are fifteen sensors in there to actually realize, âHeyâŠâ parking sensors and all kinds of things.
Clifford Brooke Stevens actually took that further â and you can see that he is a very content and happy person â because he came up with the idea of the planned and built-in obsolescence. You donât even need to make things break, you just have to make them look old and look outdated. You have to instill in the buyer the desire to own something a little newer, a little better, a little sooner than is necessary.
Every advertising is about this. Everything we see on telly is like, âThis now has rounded corners.â Okay. How many people really feel like âOh now I need thisâ. I was at Mobile World Congress and they showed all these hardware providers who went there and I went to every stand and asked, âWhat do you have?â âWe got a new phone.â âWhat does it do?â âItâs bigger.â âOkay, is it faster too?â âOh yeah, itâs faster too.â âWhat else does it do?â âItâs bigger and nicer andâŠâ Itâs no change. Itâs just like a constant change in there that has to happen.
Perceived obsolescence is the next. Planned style obsolescence occurs when marketers change the styling of products so consumers will purchase products more frequently. The style changes are designed to make the owners of the old model feel out of date. You feel embarrassed pulling your first generation iPhone out in the coffee shop in San Francisco. This is because of this. Weâve been trained to think that things have to be outdated quickly and theyâve got to get new, new, new, new.
These shoes are 12 years old. Doc Martens in England. Now that Doc Martens has been sold to a company somewhere in the East, Doc Martens break within a year now as well. These ones donât yet. So I will be very unhappy when they break.
Itâs just amazing how we got into that. Other people thought it already as well. This was the â50s and everybodyâs, âOh my God, weâve got to do this.â Then in the â60s some cynical mind basically said the systemic attempt of business to make us wasteful, debt ridden and permanently discontented individuals. To a degree, thatâs right. People really, really rack up their credit card bills to get a new smartphone that they donât need because they actually have a good smartphone already, but they want to be the new cool ones to have to swag and be awesome about it.
In essence, this is not our struggle. This is Appleâs and Googleâs struggle and Samsungâs struggle and hardware makersâ struggle. We cannot compete with that. We cannot go and say, âLook, websites, you can edit it, you can change it, you can change the interface of a website. It will be maintainable for five years in the future.â No, no, no this thing has to break tomorrow. What can you give me that makes people buy a new phone because they want to have the next version of that game? This happens.
Web development and native development cannot be compared one to one. We always do these HTML 5 showcases where we show that HTML 5 could be like native apps. Then we make it work across all the browsers and across all the platforms like we should in HTML 5, and it turns out not to be as performing and as good as the native app. If you really want to prove that it does the same, do it on one platform, one browser and one configuration. This is not HTML 5, this is just making a native app in some environment that should not be native.
Fragmentation to us is a given. I never knew what browser you use. Hopefully Firefox, otherwise you have a bad time. I didnât know what connection you have. I donât know what resolution you have. I donât know if youâre drunk. I donât know if you can read English. I donât know if youâre sober but you canât read English. I donât know anything about you and I love that. I love to write defensive code that actually says, âCan you do this?â âYes.â âOkay, do this.â
@supports was put in Firefox Nightly yesterday, so basically you can have modernizer in CSS itself and in JavaScript. Thatâs kind of the stuff we need. All of these things [different hardware on screen] should get something. They should not get the same. They should get something that people can stomach.
To me itâs this golden playground. Itâs a bit like Temple Run. Youâve got this street full of gold and thereâs all kinds stumbling blocks and stuff, and we actually have to fix these stumbling blocks. Itâs a bit like the 101. You go down to the Silicon Valley, you see how many millions of dollars are spent on different companies and youâve got all these potholes at the same time.
The mobile web is there for us to make a good living with, but we just try to go for that big gold gem in the sky all the time. We want to be that $30 million seventeen-year-old kid that got bought by some company because this is the future. This is the same ⊠I donât want to say a strong word. This is the same lie that we have with this built-in obsolescence.
Yes, there will be one guy whoâs actually starting to Facebook, there will be one guy who gets $1 billion for his company, but this is not maintainable. Not all of you can be that guy, and not all of you probably want to be that guy because they donât have free time in their life anymore and a lot of pressure on them.
Who here plays an instrument or sings in a band? Why? You can never be as good and as successful and fast and rich as Justin Bieber. You donât need to play your instrument, you need a producer. You need a nice dance move, you need some swag, and thatâs about it. Why do you bother with this? You cannot be Justin Bieber. Heâs much younger than you, heâs much faster than you, heâs much better than you.
Why do you do it? Because you like it. Itâs fun to do. A musician is a person that takes thousand of dollars of gear 100 miles away to play $100 gig, because we love it. Because we want to do things and we donât want that mainstream mediocrity that means that if you do the Justin Bieber thing and youâre successful for half a year youâre going to be in rehab two years later. So letâs play the long game a bit and think about what youâre going to do in 10 years with that, rather than, âOh, money, money, money, more, more, bigger, bigger, bigger.â
We need lateral thinking. Which line of this one is longer? The upper, downer? Are they the same? No, theyâre not. So why did all of you think that this is the same length? Because youâve seen that thing before, itâs an old trick. Itâs an old trap. Itâs a clever trap. Itâs obvious that they should different lengths, but it actually isnât. Youâre like, âIâve seen that, youâre not going to get me again with this.â
This is how we build things right now. We learn hacks in browsers and then we internalize them and say, âThe web will always be shit at that so I cannot do that in the future. I will do it like this for the next 15 years and, âThe web just canât do it, Iâm sorry.ââ Letâs think about it. Letâs measure things. Donât get too excited about measuring like this. Lots of people get JS perf and these kinds of things, but itâs just like you can measure things but you have to measure them in context. Donât fall into the too-clever trap. Donât see the thing for the first time and you remember it didnât work last time and say, âItâs not going to work again.â
What do we do now, instead of thinking about why we come and use the web? We build many, many, many, many awesome solutions. We build so many awesome solutions itâs incredible. Weâve got this Bootstrap. You donât need to learn any HTML, just use Bootstrap and start from that if youâre not a professional. Grunt, Ember, Backbone, jQuery, Sencha, Hammer.js, Emmett, Compass, SASS, LESS, Zepto, blah blah blah, all these cool things that are coming out.
All of these things are great. They really are good. They are tools for power users that need to actually make their day-to-day job easier. Theyâre great. We just make new ones every month, thatâs the problem with it, but we actually want to be more professional about it so we tell people, âThese are the things you have to use, otherwise you are not really a web developer.â When I hear people say you need to know command line to be a web developer Iâm like, âNo, sorry, this is not the same. The command line is not on the web. You build things that are visual, you build interfaces, you build things that people need.â
Weâve got many, many awesome demos. This was going around a few months ago, a few weeks ago, a very, very remembrable URL fff.cmicmcn.com which showed all kinds of playful things and HTML 5 canvas demos and stuff. All of the things weâve done in Flash four years ago and we now use in HTML 5 and we say, âThis is awesome.â I think what we are having right now is an overflow of awesome.
Iâm getting tired of seeing awesome, awesome, awesome, awesome. What I want to see is, âWeâve got this really terrible content management system. We have a room booking system, hereâs how we fix it with HTML. Hereâs how we made people happy across five different platforms.â
We donât have to impress each other. We have to impress the mainstream. So stop building tools for each other and making the other tool do one thing less than the other one does. Theyâre all open source. Fork them, do things with them. Donât build your own again.
I get excited about people building things. Iâve just been at POSCON in South Carolina, and all the developers you meet there are actually in small companies or freelancers. You show them something, I did a CCS 3 talk and two weeks later you get an email, âOh, thanks for your talk, here is how I implemented it into my product.â Iâm like, âYes, this is exactly what I want to do.â Please build these things. Give it out to the main market. Donât be excited that everybody is clever on stage and then be depressed that youâre not on stage and you build your own system so you get on stage. Thatâs a bit of loop we do at the moment.
The other day I had a guy in my gym in London ask me, âHey youâve got a computer, so you know about the Internet?â Iâm like, âThatâs obviously an interesting fallacy.â Heâs like, âOh, I want to get a new job. I want to learn about the Internet stuff. People say itâs really good to be a web developer and itâs a really good job to know that.â So I found this old laptop in my house that I cleaned up and I just put Ubuntu on it and a text editor and an HTML 5 book, and thatâs what I gave him. I didnât tell him, âUse Grunt, use Ember, start with Bootstrap.â Thatâs how I learned it, thatâs how I got incredibly excited realizing that if I put a different color in there it looks different. Wow.
We can do that nowadays. The web needs no massive tools for production, for power users. Tools are great. For starters, donât overload them with things that they canât rely on in the future. All of these things are not built in the browser, so they might get outdated. They might get replaced. Donât teach people things that are for just for the next two months.
How do we disrupt? How do we change that whole market? How do we get back to that idea that from the very beginning we said software is on the web and content is on the web, and itâs distributed worldwide without having to send floppy discs and CDs to each other? How do we go back to that?
The first thing is to stop being scared. Last year we had a few interesting things on stage here where people said, âMaybe the web is over. Maybe the web is going away.â Weâve got to keep the lights going. Weâve got to keep the lights going! I mean who of you as a web developer has problems paying their electricity bill? I didnât know it was that high in San Francisco. My brotherâs a fire man, he canât find a job at the moment or a better job. He hates his job. But when he doesnât do his job, people burn. When we donât do our job things are five pixels off.
Donât be worried about the future of the web. The web survived Flash. The web survived Java. The web survived Java Server Faces. The web survived any kinds of things out there because itâs a distribution model. Itâs not technology. Itâs not a certain stack of technology.
Will the web be the same in seven years? Hell, no. It will not be the same next month. Thatâs the power of the web. It keeps mutating. It keeps getting better. You cannot compare it with systems that are actually, âThis is version one of the web, this is version two of the web.â No. This is worldwide changing constantly every second, and thatâs the cool thing about it.
Chill out. Breathe. Youâre going to have a job in five years, ten yearâs time easily if you bet on the web right now. It may not be the same job, you have to be up on your feet and learn new things, but thatâs what makes it interesting. I always hated a job that I got a pamphlet and like, âThis is what you are going to be doing the next twelve years. No change, donât worry about it.â
On the web, different story. New challenges every single day. I think we should stop copying. A lot of people, âOh, thereâs a native app that everybody uses right now, so letâs copy that in HTML 5. Letâs copy that in our technologies.â No, itâs a different idea. First of all youâve got your obsolescence thing. Not every native app has everything in there in the beginning because they want to roll it out. If your app has all the features at the beginning youâre not going to have good time. You want to roll it out month by month by month. Trying to keep up with that is not possible.
Try to actually see the power of the web and the benefits of the web, of web technologies over native technologies. The biggest one is flexibility. If your app is not flexible you are doing it wrong. The thing should actually tell the user, âOkay, this works, this works, this works. I have a problem with that so I donât give you that functionality.â Or just donât show the functionality. Donât promise things that you canât fulfill. Itâs an if statement, itâs not that hard to do.
If you copy, then kick ass. Sencha did this Fastbook and showed that the whole HTML 5 and stuff from Facebook was actually a misnomer and actually based on wrong assumptions. They did a good thing there and they showed basically that you can do a fast app on an iPhone in HTML 5, who should have known, like the ex-CEO of the company wanted it to be. Thatâs great. If you do these kinds of things then we should stop saying, âYeah, but it only works in IOS and it only works in that.â Yeah, thatâs what we cared about it in this moment.
We are fixing it together with them right now, and Flexbox is now in Firefox partly because Sencha Fastbook wanted to have it. We actually had a real, real good reason and demo to actually see what the problem was.
The other way to disrupt is to go where others donât go. The problem is theyâll be like, âif you want to make money now only go for the iPhone market in America. Thatâs where people spend money.â This earth is this round blue thing and thereâs these people, people everywhere and they want to do things on the web as well. Why not tap into a market that is not there for others? Why not tap into a market where the people that are actually driven by obsolescence cannot go, because the market canât afford it, because the market canât do it?
That is what we are doing with Firefox OS. Iâm not here to make a pitch. Iâll just say what it is right now, because it is 90% of my life at the moment and I get incredibly excited about. We went to the Mobile World Congress, which is the most evil sales show on this planet. I spent two days just reporting incidents of booth babes to blogs in America that talk about inequality at conferences.
We rocked that thing. We were in every headline. Everybody released new phones, everybody released new things, and Firefox as an open source company, as a non-for profit organization giving out a free operating system was the main headline. Why? Because we got 18 mobile partners to partner with us and four hardware partners to bring out phones that are internet connected, that are web connected with smartphone functionality to markets that cannot get iPhones and that cannot get Android phones and canât afford them.
Emerging markets like South America, like Eastern Europe, we have a lot of partners that go out to them. These arenât partners that sell the thing with us, these are partners that actually code the thing with us. Instead of just having salespeople around them, weâre just like, âOkay you want to be part of this? Show us your engineers.â This is what where doing with that.
What Firefox OS does is replace old feature phones. We donât replace the Androids, we donât replace the IOSâs because we canât compete on that market. We donât have the marketing budget, we donât have actually the hardware, we donât have the people that want to actually partner with us because theyâre like, âWeâre just stinky free open hippies, thatâs not right to work with.â
One of the main differentiators for us here in Firefox OS is first of all that everything is HTML 5 on that phone. Nothing in here is Java or Cocoa or Objective C. This is all HTML 5 and itâs on Github. You can go play with it. Of course for the mainstream market this means, âOh, who cares?â What people care about is actually making it easier for them to find apps and to play with apps.
What is easy? Finding things on the internet. Maybe a search functionality, maybe something like playing with it. If you go on Firefox OS and hopefully my connector is working here, and I have a mouse somewhere, there you go. This is the emulator that was just put into Firefox as an add-on. Once you put it in there and it starts ⊠Why does it do that to me when I go on stage? There you go. You can start the emulator. This is what it looks like. You got the error console, you can play with it, and this is the operating system itself.
If I go to a market right now and I want to have an app about my favorite band, I want to know something about a band, what do I do? I click through music apps, then I got 6000 of them, all of them reviewed by probably paid reviewers. I donât know the name of those things. I donât know what to do. Thatâs why we have to pay posters. Thatâs why we have to pay advertising, to get our name of our app into peopleâs heads. This is software, this is indexable software, why do we need this?
In Firefox OS, if you go here, you search for example Nine Inch Nails. Letâs do a good band. You get the background already changed into Nine Inch Nails and you get ⊠oh we have nine here, wonderful. Thereâs a space in there, that was the problem. Letâs use U2 as another demo.
U2. Iâve got my background here. It changed into U2. Iâve got YouTube for videos, Iâve got Grooveshark for music, Iâve got SoundCloud for music, Wikipedia for written information. I can buy tickets on Songkick. It realized that I was entering a band and gave me your applications, anybodyâs applications that are submitted in the market or are on the web. These are not the apps that are in my phone, these are apps on the web.
I can now click on this one for example, Grooveshark, and start listening to a U2 song if I really donât like my life. Once I had a good experience with that app, I can go back and do a long click on the app and install it. A long click will then install it on the operating system. It will operate it like a bookmark like it does in IOS. It actually will install it with app cache, with everything going offline and giving you access to the hardware in ways that IOS doesnât give you.
We made app discovery and app try before you buy as simple as actually surfing the web. If you have a mobile website and you want to sell an app, your mobile website is your advertisement for the app because we can index that for you and you can actually show up and do search results. This is bringing search technology to the app world, which is very interesting to me. I think itâs just, for you, a good idea to spruce up your mobile HTML versions that you have right now of your pages. You can play with that yourself.
Somewhere Iâve got my presentation again. There you go. I found that hard to explain to people at times. Once they started playing with it they entered a movie title and then they realized, âThereâs movie apps, thereâs Flixster, I can watch these movies.â You go from the use case to the app and from the app to the use case, which is what we do with closed markets right now.
The other thing we do is we enable hardware access. Youâve got all these APIâs to access the hardware directly from JavaScript. The vibration API, which was called Vibrator API, I made too many stupid jokes, geo-location was one of the first things that we did years and years ago and then it went out to all the browsers. All of these APIs are not inside a SDK, these are standardized API proposals that other browsers can implement as well. Geo-location is across all browsers, the battery API is across all browsers. Network information, speed connectivity APIs have been used for others as well, indexedDB has been used by others.
You get full access to the hardware. That was always the problem in the iPhone, basically you got promise to access the hardware but you couldnât get to it. You just had to build a native app going through PhoneGap or something like that. The other thing we did, of course we cannot allow any app to access every piece of the hardware, because you could make a puzzle game that calls 1-900 numbers in the background and racks up lots and lots of money. We actually have to review some apps in terms of security, how much access to the hardware you want.
We also came up with a system called Web Activities, which was much like Web Intents in Chrome, but itâs actually active. What it does, it allows you to use other apps to do something on your behalf. If you want to do a telephone call you have to have an app that is listed in the marketplace and reviewed by Firefox or by Mozilla. If you want to just do a telephone call from a web app that you host on your own server, you can use the telephony pick API here, so youâve got the pick action. Nope. Okay, again.
You need a photo. If you want to have a photo you just call a pick action. You donât care where the photo comes from. You donât want to know if itâs from the gallery, from the wallpaper or if itâs from the camera. Thatâs what you do. You do a pick action, the user then chooses which ones he wants to actually use. Give you a photo; you get the photo back.
Same with the telephone call, you give the telephone action a call ⊠telephone number. It switches to the dialer app. The user has to initiate the call. You donât do it on their behalf. Itâs up to them to actually make that call. Once they hang up you go back to your app automatically and you get the duration of the call and the telephone number that was called.
The difference to the pseudo-protocols and things that we had on IOS is that you get a feedback loop. You bring something to a native app and then you get the data back. That is cool because I donât want to use your phone app all the time. I have a phone app that works fine on my phone. Why canât I just use that? The Web Activities allow you actually to ⊠any websites and any web app, to actually tie into other native apps of the operating system.
That works across Android and that works across Firefox OS as well. I love that because I donât want to be in control for that. I donât want to have your Flickr or Twitter or whatever credentials. These are yours, donât give me them. Itâs your way to share it on Twitter. Itâs yours to actually take away. I donât want my app to be responsible for things happening on your Twitter stream.
That is right now happening because we identify on behalf of the user the whole time. Web Activities allow any HTML 5 app to go into native apps and do their thing and get the data back. Itâs much more important to me then actually accessing it myself and getting their information.
It works well with others. If you put Firefox on your Android all of these things, well not all of the APIs but the Web Activities, for example, work as well. So you can do that. Firefox for Android supports down to Froyo, so you donât need the newest coolest Android to actually get HTML 5 support, sensible HTML 5 support.
Opera does the same thing now. Opera is also a browser you can install on Android to go back to an old version of android, rather than having Chrome only on the newest one.
Another big thing that we just released is that you shouldnât make people think about the web but just come halfway. At the game conference that was just here in San Francisco weâve announced ASM.js, which is also ⊠thereâs a meetup at 6:00 in our office today on the Eventbrite I think. What that one is, it actually allows you to convert C++ games or C++ code into JavaScript code.
If youâre a C++ company and you want to do something on the web but you really donât want to re-educate all of your developers onto JavaScript because C++ guys looking at JavaScript makes them covered in hives and stuff, you can use that. One thing that we announce is the Unreal 3D engine, now running in JavaScript and Canvas and web GL in the browsers. You donât need Flash to run 3D games.
Electronic Arts was one of our partners to actually bring out the 3D gaming onto the web and just convert their apps, convert their games, not write them from scratch because thatâs not going to happen. We want to have the fidelity of 3D gaming on the web but we donât want people to have to write from scratch, so we wrote a converter.
Same as the PDF displayer in the browser â it is also done through the same engine. Instead of having a plug-in that gets hacked every two months we just ran the PDF in JavaScript and the original thing was a C++ library. If youâve got cool C++ stuff right now you can convert it to JavaScript rather than learning JavaScript, which to me is a handshake back to the 1980s where we can work together. The web will not replace you. We want your stuff. Thatâs what we do.
What can you do? How can you be part of that? The first thing that I have not seen yet and I want to see much more is context aware applications. Everybody has ⊠okay this is a responsive design, itâs smaller on the phone and shows five buttons and itâs bigger on the other one. It doesnât change the context. It doesnât give you a way to actually work with it.
Imagine a company that actually has a guy walking around going to meetings. The interface on the phone could be start it there, find my location, stop the meeting there. When he goes back into his office and starts the desktop, he opens the same app, the same HTML app, and it actually shows him, âOkay, hereâs what you did today. Please put the notes in there. Please put the photos in there. Upload the other stuff.â We do different things that we do on a phone than we do on a desktop.
We shouldnât just make everything dumber because the mobile phone is the clever thing. We should give you a context aware app. What do you want to do on a desktop? What do you want to do on a mobile? What do you want to do on a tablet? Give you the best experience on all of these. HTML 5 is the only technology that allows you to do that because a native app cannot do this. You have to install three different apps on three different platforms.
Thatâs just not clever to me. That just doesnât make any sense, that I have Temple Run on my tablet and my mobile phone, theyâre out of sync and I have to do the same challenges on both of them? Thatâs just terrible for a small problem but itâs just not nice.
Go small. Go offline. If you can cut out a few kâs cut out a few kâs. If you can make the thing work offline that people can enter things while theyâre actually waiting for it to load, great, thatâs what we want. We want this experience to be as smooth as possible because we are impatient when we are on the phone.
We donât really care about reloading a page three times on our desktop but on the phone itâs like, âThis is broken, this is broken.â I love it in maps when people like, âWe canât find the map.â âWell itâs going to space for you, be a bit more grateful.â When Iâm here, one pound, fifty per megabyte Internet roaming. If you have this 20 MB animated gif landing page, I hate you.
Fix the first generation mobile web. This was the login system at the airport in Barcelona, how it looked on my Android. Well thatâs fun. Especially when you go through a second step it asked you for your passport number to get fifteen minutes of Internet access. Sure, I found somebody elseâs passport so itâs all good.
That shouldnât happen anymore. This is just silly. This is just ⊠a viewport meta tag should be enough to fix that kind of crap. Make sure you realize ⊠weâve got wonderful things like VW and VH now in CSS as well, it can make typography resize according to the size of the screen. We can make the flexibility that Flash had years ago in web technologies easily nowadays.
Trust and help the platforms. Youâre complaining that something doesnât work in Firefox. Go to Bugzilla, complain, be annoying, put screenshots there. Put test cases there. Tell people what is wrong. Donât go on Twitter and say, âOh, Firefox does this wrong; I hope somebody from Firefox reads this and does my work for me.â
Same with Chrome, same with Opera, same with Internet Explorer, all of these things are available to you to complain where people are working on them. Not where we get applause from other people when we complain about them. Help us make the web better by using what browsers put in. I told you about @supports. Look at that tonight. Donât animate anything in JavaScript. We cannot hardware accelerate your JavaScript animations. We can hardware accelerate anything in CSS because thatâs our engine, but when you simulate what the browsers do natively we cannot help you make the web faster. Then itâs no help complaining that browsers are slow. You made that. You took over the browserâs job, so you make it fast.
Let us do what we need to do. Use translate instead of top and left. Use CSS animation. Use CSS transitions instead of JavaScript animate. We can make the thing better. Every six weeks thereâs a new browser out. These things change constantly, please use that stuff. Give us feedback, what is necessary, what is unnecessary, what you like, what you donât like. Jump right in, itâs fun. Yes itâs messy, but hey, this is fun.
Nothing stops you from actually helping the web of the future by helping the people who build the platform of the web. You can be massively successful tomorrow with a great native app. Good luck. Have fun with it. In half a yearâs time it is going to be obsolete because the next one has to come. If you want to do that, if you want to play on the web, play by its wonderful, open rules and be successful by sharing and actually playing with things that come in there.
Every week I find something new in browsers and it gets me terribly excited. Itâs a sad life. If I had some of the things that I had in the past ⊠that I didnât in the past, I would be on a beach now or something because I wouldnât have to work anymore. Every browser is a developer platform. Every browser is a conversion tool. Reader Mode in browsers allows you to actually fix a lot of sites and actually read them nicely rather than have to click through two thousand ads. With that, I am out of time. I thank you very much.
Posted in General | Comments Off on âSetting disruptors to stunâ â keynote video and transcript now available.
I am currently in Las Vegas for the Anglebrackets conference and after suffering a American country music festival in my hotel I got up this morning to deliver the keynote, talking about using web standards and approaching web development in a simpler fashion. Here is the abstract.
Web development as it is right now suffers from an obesity problem. When computers and connections were slow we had to be frugal with our resources and optimised for the user, and not for us as developers. Our amazing machines and fast connections now allow us to not worry too much about page weight and dependencies. Or so we think. The move of our end users from desktop machines to mobile environments mean that a lot of what our products need is not available and â without being able to test those scenarios â we deliver a terrible experience. In this talk Chris Heilmann of Mozilla is going to show how using HTML5 and plain JavaScript together with CSS can help us build fast, beautiful experiences for the desktop and the mobile web and the next generation of platforms around the corner.
I just got off stage at the HTML5 Developer conference in San Francisco, California. The massive ballroom was packed with folk and my task was to set the mood for the day and be inspiring. Turns out it seems it worked well.
The abstract I submitted was this:
When the web came around it shook the foundation of IT at that time. World wide distribution independent of platform and environment? People allowed to write code without having a degree, a beard or suspenders? Unthinkable! Now we are the mainstream and the pendulum swings the other way â we are the disruption target and we lose our users to closed, specialised environments. Or do we? There is nothing stopping you from dazzling audiences with web technologies â all you need to do is to get back some of the excitement we felt when we fought the machine. In this keynote Chris Heilmann will show how you can get your web mojo back and reach a market of millions of new users that will be available to you this year. All you need to do is to give your web apps more love and stop trying to copy what you cannot deliver.
Here are the materials of the talk â and I will release the notes in a cleaner fashion later.
The slides are on the web and a screencast on YouTube. This is a raw screencast recorded on stage, so the sound quality is not the best. There was a video recording and you should soon be able to see that online.
In the afternoon of the second day of Posscon I was asked to give a talk on the benefits of CSS3. Instead of having a presentation I put together an interactive slide deck with direct Q&A. Here is the recording of the session.
In the session I covered the benefits and pitfalls of using CSS and showed how newer features like advanced selectors, pseudo selectors, transforms, transitions and animations can make it easier for you to create beautiful web products with much less code than before.
Posted in General | Comments Off on CSS3 â know your arsenal â a show and tell at Posscon