This is an archived copy of all my blog posts which is irregularly updated. For my latest blog posts see the Mbed Developer Blog.
  • Power consumption

    My idea for Gonzo, from the very moment the idea sparked in my head last September (although that’s another story), was that we should aim for insane battery life. I want people to put up their Gonzo at hard to reach places without them having to worry to charge the device every week. That means that power consumption was our biggest concern when we started doing this project. How do you keep a device alive for at least a month? How much battery do we need to fulfill all our wishes, etc? The first thing we (and by we, I actually mean Thomas) did to achieve this goal was to set up proper power measurement equipment. A nice thing about reusing existing hardware is that a big portion of the work was already done for us by Mozilla engineer Jon Hylands. For power measurement you need a (3D printed) harness, a PCB to connect battery and main board, a power meter, and some software to read the data from the meter. All of that was already written up by Jon in a blog post on Mozilla Hacks.

    Although building the harness was easily done by Bjørn (it even fitted the battery for the Geeksphone Keon the very first time), we didn’t have any PCBs until two weeks later, so our first power measurement tool was professionaly soldered together by Thomas.

    Continue reading »

  • Timelapse

    Timelapse of the sky. Gonzo can function both horizontal & vertical position. It uses accelerometer data to rotate the picture automatically.

    Gonzo generates a lot of data. Our demo models currently make a picture every 30 seconds, mainly so we can see battery drain quickly, totalling at 2,880 photo’s a day. When you have to navigate this many photo’s you want to glaze over them as quickly as possible. To facilitate that we listen to the mousewheel event and change the photos using that which you can then use to quickly ‘fly’ over a stream. Something you learn when you interact with the stream that way is that when a Gonzo is stationary, you can create some pretty amazing timelapses. With that in mind I hacked my Friday morning away on a simple timelapse feature. First thing to do is of course to put one of our prototypes in front of the canals in Amsterdam.

    Continue reading »

  • Managing configuration on the device

    There is a variety of configuration options on the device that need to be managed, from the interval in which photos are made, to the API URL of the server. When you think over all the configuration options we have we can put them in three categories:

    1. Hard coded in the source code, e.g. the location of the API
    2. Local configuration, e.g. the PIN code of the SIM card in the device
    3. Remote configuration, e.g. the JPEG compression rate on photos

    In general you want your basic configuration file to look completely OK so when someone flashes the device everything works out of the box. Sometimes it is required that pre-build time you configure some options, like the PIN code or whether you want to roam on the SIM card. Other options need to be changable from distance, because you would not want to re-flash a device to change the interval it makes photos in.

    To accomodate for this we use a couple of techniques. First, we use architect, a dependency injection framework, to abstract away modules and their configuration on the device. We have a base configuration file that lists all the modules we have and we can specify options on a per-module basis. For example:

    Continue reading »

  • The significance of the 33$ Firefox OS smartphone

    This article is a reworked abstract from my book Firefox OS in Action. The first few chapters are currently available under early access at http://manning.com/jongboom/. You'll get 50% off with code 'dotd082714au' if you buy it on August 27.

    The launch of Firefox OS phones in India yesterday made a lot of buzz. Major reason: for the first time a smartphone was launched for a price under 2,000 rupees (¤25 or $33). This might seem insignificant in the 'first world', where every teenager runs around with a $700 iPhone in their pockets, but will make a huge impact in the third world. In this article I'd like to talk about the reasons why we have focused on breaking the price barrier, and about the choices in architecture that we made to facilitate this.

    While internet is a commodity for most readers of this article, this is not the case for the majority of people on this planet. At the moment of writing an astonishing 4.2 billion people do not have access to the greatest source of information that humankind has ever created. There are more people that do not have access to the internet, than those who do. One of the main goals (for me *the* main goal) of Firefox OS is to change this.

    Continue reading »

  • Building applications for Firefox OS using AngularJS

    When you start developing for Firefox OS you might be underwhelmed by the tools that are provided. There is no standard UI toolkit, or a JavaScript framework that all apps build on. This is not a situation that’s inherently bad because in essence Firefox OS is the web; and thus gives you complete freedom in the toolchain you use. This gives us the advantage to use any new technology that pops up also on Firefox OS. The downside is that you’ll miss out on things you might be used to on Android or iOS, like built-in templates; view transitions and UI components.

    Continue reading »

  • I wrote a book: Firefox OS in Action

    About 9 months ago an acquisition editor from Manning Publications first approached me, asking whether I was interested in writing a book about Firefox OS app development. Being a contributor, module peer for keyboard, and evangelist for Telenor, that actually made sense. Even when almost everyone in my environment that ever wrote a book said: "Yeah, it sounds fun, but actually its horrible". In a way they were right, especially the start was though; but during the process I actually had more and more fun. The fruit of the labour has now been bundled in an early access version of my book "Firefox OS in Action".

    Continue reading »

  • Fix your own smartphone OS

    If you're an avid smartphone user there will be times when there is behavior on your phone that just doesn't make sense, and that annoys the crap out of you. Well, you're not alone! Same thing happens to me, and I'm even a full time developer on Firefox OS. One of the things that bugs me the most is the behavior of the address bar in the browser. When you scroll enough down, it will disappear, but the content jumps up under your finger. And content jumping is the @#*&*#@&#&$ annoying.

    Time to fix it!

    So Firefox OS is built on top of open standards, HTML, JavaScript, blah, blah, blah, but the only real important thing here is, is that every (system) app is built on top of web technology. And thus, it's not compiled. That's actually pretty cool, because what I could do is grab the source code of the whole frontend of the OS; make changes; and then push to my phone. Sure. But that takes long, and maybe you miss a build prerequisite, etc. Luckily, because the browser app is basically a website, we can just pull the app from the phone and edit it.

    Continue reading »

  • Simple EventEmitter in one line in javascript

    Chances are that if you have a large javascript application that you'll need an EventEmitter at one moment or another because events are great to wire separate modules together without them having to expose implementation details. Too bad that you'll need to pull in dependencies, another library, extra risk, etc. Especially if you're testing some simple scenario or small app that's a lot of boilerplate. Behold: a dependency-less event emitter (1 line of javascript!):

    Continue reading »

  • Simple function logger in JS

    Every now and then I end up in a code base where I don't have a clue about the flow yet; like today when testing out the new keyboard application that we're developing for Firefox OS. To see whether the flow is actually sane I plug in a simple function logger that allows me to see which functions are called and with what arguments.

    Continue reading »

  • Simple async queue in javascript

    Normally I fall back to caolan's async module, but I'm not in a node.js environment and I needed a simple async queue with concurrency 1; which can be done in a one liner.

    Continue reading »