First Hacking Firefox OS day in Madrid

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.

Hack fun!

Borja and Guillermo

Advertisements

Building B2G from scracth

Hi all!

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 🙂

  1. Prerequisites:
    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
  2. 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.
    wget http://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/mozilla-central.hg
    hg init src
    cd src
    hg unbundle /path/to/your/mozilla-central.hg

    Add the following content to the file src/.hg/hgrc

    [paths]
    default = http://hg.mozilla.org/mozilla-central/
    hg pull
    hg up
  3. 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_OBJDIR=../obj-b2g
    mk_add_options MOZ_MAKE_FLAGS="-j4 -s"
    ac_add_options --enable-application=b2g
    ac_add_options --disable-libjpeg-turbo
    ac_add_options --enable-tests
    ac_add_options --enable-b2g-ril
  4. Now you are ready to compile, execute from the srcdirectory:
    make -f client.mk
  5. 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:
    cd ../obj-b2g/dist/bin/

    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!!