SlideShare verwendet Cookies, um die Funktionalität und Leistungsfähigkeit der Webseite zu verbessern und Ihnen relevante Werbung bereitzustellen. Wenn Sie diese Webseite weiter besuchen, erklären Sie sich mit der Verwendung von Cookies auf dieser Seite einverstanden. Lesen Sie bitte unsere Nutzervereinbarung und die Datenschutzrichtlinie.
SlideShare verwendet Cookies, um die Funktionalität und Leistungsfähigkeit der Webseite zu verbessern und Ihnen relevante Werbung bereitzustellen. Wenn Sie diese Webseite weiter besuchen, erklären Sie sich mit der Verwendung von Cookies auf dieser Seite einverstanden. Lesen Sie bitte unsere unsere Datenschutzrichtlinie und die Nutzervereinbarung.
Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen.×
Aktiviere deine kostenlose 30-tägige Testversion, um unbegrenzt zu lesen.
O atfo rm
O X pl
EF as a mink
This is a talk about the Mozilla Boot to Gecko project, the technologies involved, and what it
means for the Web.
http://openwebdevice.com by Telefonica is talking about a mobile device completely powered
t to eb
Boot to Gecko, referred to as B2G, is a full operating system and platform for mobile devices.
B2G is mainly two separate things; Gecko and Gaia.
The Gecko side is pretty much everything that you don’t see.
The low level OS
The application runtime
The user interface
Photo by Alesa Dam
Gaia is the front-end operating system and application stack that hooks into the APIs that
Gaia is basically everything that you can see and interact with.
already use to create websites.
This makes it incredibly fast. I’m talking really fast, it boots and shuts down in a fraction of
the time that an iPhone does.
W uss a
But why is B2G important?
related to the future of the Web.
Pretty much every new technology that is coming out within the browser-space is connected
And what’s great is that every major browser has invested in them, so they won’t be going
anywhere any time soon.
But there’s more to it than that.
n te the s
It is created with open technologies.
Anyone can get involved in their creation; through browser developers like Mozilla, or
through standards organisations like the W3C.
Also, these technologies are open in that anyone can view the resulting code that is used
within Web pages, which is a fantastic way of learning.
e te to de
Fre . Free
It is created with free technologies.
Anyone can use these technologies without having to pay anything, both for using the
technology and developing with it.
This is unlike closed environments like iOS where you have to pay to use official code editors
and production environments.
B2G is also part of the Kilimanjaro event.
Kilimanjaro is a milestone across several of the Mozilla products; Firefox, B2G, Web Apps,
The Kilimanjaro Event is not a single release, it is an incremental effort that results in an
coherent experience across those products.
When we reach the Kilimanjaro milestone we will have an elegant and simple experience for
HTML5 Web apps in Firefox on multiple devices that puts the user in control of their apps and
‘Kilimanjaro’ is planned to be reached by September 2012.
The best way to explain B2G and to show it’s current state is to give you a quick demo.
g you bui ld
T h T
B2G is created from a whole variety of technologies, from pre-existing ones to brand new
ones that have been created speciﬁcally.
The Gecko engine lays at the core of B2G, the same engine that powers Firefox.
Needless to say, B2G isn’t just Firefox running on a phone. It’s much more than that.
Full Screen API
WebTelephony Settings API
Multitouch WebGL Camera
At Mozilla we’re working on the WebAPI effort which is our attempt at creating the APIs
needed to run a B2G device.
In other camps it might be referred to as DAP, which is the Device APIs Working Group who
The illustration above shows just a few of the APIs for B2G that we’re working on right now.
fa Is for
There are so many WebAPIs and technologies in the pipeline that relate to B2G in some way.
The following are just a few favourites.
You can ﬁnd the rest of the WebAPIs here: https://wiki.mozilla.org/WebAPI
C g th
The Camera API lets you access the camera on a device.
For example, instead of requiring a user to upload a proﬁle image you could take one using
the webcam and use that instead. Simple but effective.
SM crip t.
W ith J
The WebSMS API isn’t the most glamorous, but the idea of sending text messages with
ele d r
T e an
I can just imagine something like this being used to hook into a Web-based version of Siri
that answers your calls for you if you’re busy.
WebVibration API, previously known as the WebVibrator API
The WebNFC API is pretty cool.
It gives you the ability to transmit and receive data within distances no larger than a few
The idea is that it can be used in phones for things like payment (like the new Barclaycard),
travel (think Oyster Card), and ﬁle transfer.
e to har
W s to blu
te r us
The Full Screen API allows you to expand any HTML element to ﬁll the users screen, even if
the browser isn’t running full screen itself.
ta g of
O nd l
S h C
The Screen Orientation APIs allow you to do things like changing and locking, you guessed it,
the orientation of the screen.
Before now, it’s been incredibly difficult to lock orientation on a website or game using
WebGL brings the ability to provide advanced hardware-accelerated 2D and 3D graphics
directly within the browser.
e b ba
W e We
n n th
Open Web Apps is an initiative that is core to B2G and one that is important to the Web as a
It’s a way of creating and distributing apps that puts the developers and users of apps back
It’s a way that embraces open technology and is for the good of the Web.
It allows you to create rich HTML5 app experiences that run across multiple devices and form
factors (desktop, mobile, tablet, etc.)
It allows you to use Web standards and open technologies such as HTML5, CSS and
Anything you currently use to build a website with can be used to build an app.
o m cons
It puts you in control of every aspect of the app experience; from easy development, to
distribution, to direct communication with your customers.
The Mozilla Marketplace is our own platform for selling and distributing Web apps.
It’s in development right now but we plan to open the doors later this year.
However, there’s nothing to stop you creating your own marketplace though. All the APIs to
do that are documented and built into Firefox today. In fact, we encourage it!
g te an
G ow to c
Creating a Web app isn’t crazy hard, it’s just a case of understanding the new features in
Apps are websites and are built using the same technology and processes.
If you already know how to make a website then creating your ﬁrst Web app is a breeze.
The only thing that you need to do to turn a website into app is create an application
"description": "Exciting Open Web development action!",
"name": "Mozilla Labs",
This is a JSON ﬁle that effectively describes your application; it’s name, icons, and other
uire memb er
e nt to re
There are a couple of important things to remember when creating an application manifest.
e d ec
am nt ofs
The ﬁrst is that it needs to be hosted from the same domain as your Web app.
This is pretty straightforward and it adds an element of security in that it is unlikely that a
rouge manifest ﬁle will be able to be put on the same domain without your knowledge.
The second is that it needs to be served with a speciﬁc content type (application/x-web-app-
This is probably the most tricky process in turning a website into an app as it involves
changing settings on your server or a bit of hackery in your manifest ﬁle.
If you don’t want to ﬁddle with your server then you can always set the content-type header
using something like PHP or Node.js.
id s o
t v ng
e veryt hi
If you want to make sure your manifest is valid you can have it checked at http://
g ser o
In gh t
You can install apps in B2G through the browser or the Mozilla Marketplace.
You can also install apps on the desktop and Android using Firefox.
Installing an app
By passing the ‘install’ method a string URL to the app’s manifest ﬁle you will trigger the
An example of when you would call this method is after a user clicks on an “Install this app”
button on your own website.
It would be called automatically if your app was installed from the Mozilla Marketplace, or any
other external website.
The install method triggers an installation dialogue within the browser that allows the user to
decide what to do with the app.
On Windows, a desktop shortcut is created for the app you installed and it will also be in the
On Mac, the app is added to your /Applications directory.
On B2G, the app is added to your homescreen.
e e ju
a o lo
What is most interesting about the apps project is the ability to break away from the concept
of apps being nothing more than gloriﬁed websites.
Instead, the new functionality allows Web apps to look and act much like native applications
that you would ﬁnd in an operating system, rather than a website running within a browser.
We call this WebRT (Web run-time) and it’s really cool.
It’s really easy to use and you don’t need to do anything special as a developer to enable it in
Whenever a user requests to install an app it be be installed natively by default.
th e s
ro , or
u or d
a … es
Apps installed using WebRT are no different to any other native application that you have on
They’re installed in the standard native applications location and can be launched in the same
way that you launch any other application.
w s rs
ro and y
N s you
WebRT applications use a browser rendering engine behind the scenes but don’t display any
normal browser UI that would clutter your app.
Instead, WebRT apps look and feel like native applications while actually using HTML and
This is an example of a Web app installed as a native application. Notice the lack of browser
Right now WebRT uses the version of Firefox you already have installed to grab the rendering
In the future you won’t necessarily need a browser installed and WebRT will handle grabbing
a relevant rendering engine behind the scenes.
g B few
sin are a
There are a whole bunch of ways to start using and testing B2G today.
If you have some knowledge of git, you can clone the Gaia repository and launch Gaia using a
recent Firefox Nightly build.
- No build system and very little setup required
- Can use the Firefox dev tools
- The viewport is based on the size of the browser window
- Many device-like things won't work
- Apps are launched in separate, pinned tabs
- Firefox Nightly might be unstable
There is also gaia-devserver, a node-based tool for developing Gaia in Firefox Nightly.
Gaia in Nightly
You’ll have to resize the browser to get it looking right but it’s a great way to quickly play
with Gaia and start developing for it.
There is also a build for OSX you can use with simple instructions.
$ git clone git://github.com/canuckistani/
$ cd ./gaia-rocking
$ git submodule init
$ make setup
Run, B2G run:
1. via make > cd to the gaia-rocking
directory > make run
2. via Finder, open the gaia-rocking/bin
directory and double click on 'Launcher.app'
It is also possible to build a Boot to Gecko 'simulator' and run Gaia using this application.
This software is based on Firefox but behaves similar to the on-device experience of Boot to
If you are familiar with building the Firefox code-base or C++ projects, you can build this
- Mobile viewport, similar experience to a mobile device in most respects
- More device apis (not all)
- Need to install a C/C++ build system and build gecko
- The Firefox dev tools are not available
The last option is to build B2G on your own device.
This is the most difficult option and is only recommended on a spare device by someone who
knows what they’re doing.
We’re constantly improving the method of getting B2G onto your own device so we hope that
it will be a lot more reliable and safer in the near future.
It should be pointed out that right now Windows is unsupported as a development platform.
However, there is nothing to stop you running Ubuntu in Windows through a VM.
g to utur
tin e the
ib p c
There are plenty of ways to get involved with B2G, from development all the way to general
The best way to keep up to speed with things is to frequent the B2G mailing lists.
If you want to help with development then the best place to do that is on the B2G and Gaia
alk illa I
The general rule of thumb at Mozilla is to look for the relevant people on IRC if you want a
quick response, we tend to live on there.
The server you want is irc.mozilla.org
The channels you want are #b2g and #gaia for B2G-related stuff, #openwebapps for Open
Web Apps, and #webapi for anything about WebAPIs.
m st t
It’s amazing that we can now build an entire operating system for a phone using Web
technologies. It just blows my mind.
We really are on the threshold of something awesome here.
You should deﬁnitely start checking out B2G and the related projects, developing for them,
and helping with their development.
We’re on the path to see a day where all sorts of devices are powered by the Web, like TVs
and set-top boxes.
Perhaps we’ll even get those Internet-enabled fridges that we desire so much!
Give your input on APIs,
contribute to Gaia, Use the Web API, request features, test
contribute to B2G Use B2G and log bugs
Photo by William Quiviger