B2G2, a brain dump about Firefox OS and Geeksphone's Peak

Aras' first Pull Request

I found today's guest post on Mozilla Hacks quite interesting. It's the tale of a new Firefox OS Canadian contributor, Aras Balali Moghaddam, who describes his tribulations during his first P.R. for Gaia.

This read offers a human perspective on how to turn a will to participate to a great project into a concrete delivery. The right balance is made between each step of the process with no lengthy details on the code implementation itself.

Here's a brief recap of the main points :

It's only half of the story. I'll keep an eye on the future of this contribution to see the final phases before the merge.

You must construct additional pylons

Apparently I'm not the only one facing the frightening brick mode on my Peak.

On the B2G mailing list another enthusiast found himself in the same situation. Hopefully, Jan Jongboom gave a hint in the right direction. According to him, computer USB ports don't deliver enough power to satisfy recent phone needs. He reckons a USB charger plugged right on your wall outlets should do a better job to give an electroshock to devices.

I'll definitely have a go, because it's getting quite dramatic to have to practice an emergency reanimation on Peaky every time he sleeps for a bit too long in my drawer.

mozSms vs mozMobileMessage

First step in my quest to tame SMS Forwarding : the reception part. How does Firefox OS handle the reception of messages coming from the GSM chip of the phone? I don't want to dive in the Kernel / Gonk layer yet and prefer to focus on the Gaia part.

Let's check on the Mozilla Developer Network documentation, which should be the source of authority for this domain. According to the dedicated page about the SMS Web API, the objects are still prefixed (moz) which is no surprise considering the non standard ribbon at the top. It's been introduced in Firefox 12 (April 2012) and offers a mix of managers, messages and filters with appropriate callbacks and events.

Further digging even provide simple technical demos made by John Hammink with only the gist of the procedure. My lucky day! The basis look straightforward enough to start bootstrapping my prototype right away.

But how is it implemented in a real world application like the stock one in Gaia? The code base of the SMS app is not that huge, nevertheless it should be easier to grep only the interesting bits for now. Astonishingly, the mozSms pattern is nowhere to be found in the source! What the fox?

As you brilliant mind has already guessed, the API has changed and now relies on the mozMobileMessage namespace, a broader concept that encompasses MMS. Details of this transition are partially detailed in this Bug.

I was complaining of not being sufficiently able to live in the edge and eventually got beaten by the hard and cruel reality of toying with developer preview device. The hunt for breaking changes promises to be fun!

SMS Forwarder

Cell phones core purpose is to always stay in your pocket isn't it? At least, it seems to be the case for the vast majority of users who always carry with them their beloved gizmo in every situation.

This constant promiscuity never worked for me. Some people are scared about electrical radiations burning their balls. I'm more afraid about losing grip onto the essential events. To only feel the world through a tiny screen. I already spend way too much time in front of a computer, no need to pollute the rest of my existence.

But as a developer, I'm in the paradoxical mood to be fascinated by this mean of communication and how it radically reshaped our western civilization but to be reluctant to embrace it. For a decade I had a 1 hour per month deal with my carrier and rarely managed to completely consume it.

Maybe I felt unsatisfied of the way things could be interconnected and all this wasted potential. My biggest concern has always been SMS. I can receive email alerts with an embedded sound file (now in MP3 but used to be Real Audio not so long ago) for each voice mail message but the same can't be done with simple SMS? What the heck? And what if I want to use my paid credit to send SMS from my cozy computer keyboard?

Usually SMS I receive often decay for a while before I discover them, simply because I'm focused on working on something and the phone is muted, buried in a drawer or shaking aimlessly in another room.

Now, with Firefox OS I feel like I have the opportunity to tackle this pragmatic problem starting from these simple assumptions :

So, dear Peaky, what about acting as a simple gateway to warn my email inbox whenever a friend bip me with a texto?

I think this project will be a very nice starting point to dig deeper in the new Web APIs. Here's roughly what I intend to discover and talk about in a further series of posts :

See you along the ride in the creating process of this experimental SMS Forwarder application.

Protractor post mortem

Aras Balali Moghaddam, a Canadian engineer, just published a brief overview of the work he accomplished to create Protractor his first app for Firefox OS. This handy tool let you calculate angles of real world objects using your phone orientation sensor.

The source code is available on GitHub, but the most interesting part is without a doubt the explanation of the various choices he made along the way :

I'm looking forward to read about more cool experiences differing from the eternal To-Do List example again and again.