Last Friday we had the first Hacking Firefox OS day in Distrito C, in Telefónica Headquarters in Madrid. This was mainly a clone of the idea developed by The Lab (from O2) in London.
We started by explaining why Firefox OS (and the Open Web Device) is a game changer and why it matters for Telefónica. Also, we shown what is the underliying structure and how apps are easy developed for this platform.
But the fun part began, obviously, with the developing and hack of an app:
- We created a small app that sends SMS and places calls. Every team was able to do that in less than 10 minutes, including searching for info regarding the API, and they were surprised by how easy is to develop core functionalities of a phone in Firefox OS.
- We also had a brainstorming where we wrote down a list of applications that could be awesome to have. People from UX, Talentum and dev teams gave their ideas to develop in the following weeks.
We will be doing the development in the following weeks and post the results and findings here.
Borja and Guillermo
In this post we are going to learn how to build B2G from the sources.
What is B2G in Firefox OS? Simple is the backend part, the one close to the linux that will provide the Gecko engine to run Gaia (the html5 + css + js frontend).
If we compile B2G, we can run int from our computer, that means we will have an emulator!
But wait … Mozilla is already creating nightly builds for us, that we can run in our computers, why I would need to compile by myself? Simple … cause then we can modify the source code!! Isn’t that awesome?
Ok, so get ready, we are going to compile B2G in a Mac, quite similar for Linux
Let’s get some tools for compiling and fetching the code. Building B2G is like building any other mozilla product so you can check this instructions for mac here and for linux here.
$ brew install yasm mercurial libidl
$ brew install https://raw.github.com/Homebrew/homebrew-versions/master/autoconf213.rb
- Getting the code from Mozilla CentralWe will get the code using a Mercurial bundle, that is a compressed version of the repository, then we will update it with lates changes.
hg init src
hg unbundle /path/to/your/mozilla-central.hg
Add the following content to the file src/.hg/hgrc
default = http://hg.mozilla.org/mozilla-central/
- Once you do that you will have an updated version of the Mozilla code in the src directory. Now let’s add the configuration options to compile B2G.
Create a file in the directory src called .mozconfigwith the following content:
mk_add_options MOZ_MAKE_FLAGS="-j4 -s"
- Now you are ready to compile, execute from the srcdirectory:
make -f client.mk
- Ok the compilation (after a while) finished, where are my binaries??? Remember the .mozconfig file? Remember the option MOZ_OBJDIR, we setup to ../obj-b2g, so our binaries will be:
In that directory we have an executable b2g, the same that runs in the mobile but you can run it from your computer!
Cool, so now you have your own emulator, build gaia (you can read it from previous posts) remember when building you will have a profile directory.
Running using your B2G emulator \o/:
./b2g -profile /path/to/your/gaia/profile -jsconsole
Yeah! Next steps … modifying the operating system!!
Check Evelina, Ruth and Cristian creation: Go Away Time.
You have your shiny Open Web Device running Firefox OS, and you setup an interval where no one can call, that means, all call will be rejected and the caller receives an sms explaining that you want peace
Ian Griggs showing his hack, My O2 Friends, an integration with the Firefox OS contacts application.
Here we can see how we enter the contacts application and those contacts that are from O2, are annotated with an icon next to hem.
Drive to improve ported from PhoneGap