kvz.io
Published on

Yesterday I Wrote My First Firefox OS App

Authors
  • avatar
    Name
    Kevin van Zonneveld
    Twitter
    @kvz

Yesterday I wrote my first Firefox OS App.

For now it's called kbt2 and it's a round timer that I can use to give kickboxing lessons.

After:

  • a few very frustrating hours dealing with the unintuitive and sometimes even failing Everlast Round Timer
  • knowing that I could not use my own phone as it will be playing music during kickboxing sessions
  • having a spare Firefox Developer Preview Phone thanks to Sergi Mansilla and a lucky raffle on a Decode Friday meetup
  • knowing that building Firefox OS apps is as easy as creating a HTML site with some json inside a ./manifest.webapp for app definition, and JavaScript calls to make it e.g. vibrate

.. I decided to use my geekphone as a dedicated interval timer / instruction guide and started hacking on an app for that. It all went remarkably smooth.

Here's the phone:

keon_mobile01

It's a "Keon" Developer Preview by Geekphone. I was lucky to win one, but told they'll only be 50$.

You point its web browser to the location of your app. Your app can detect the phone and offer an install via a simple navigator.mozApps.install()

screen shot 2013-08-12 at 12 14 43 pm

This basically copies all the assets listed in ./manifest.appcache to your phone, so it can be accessed without internet (awesome cause there's bad reception inside the gym :)

screen shot 2013-08-12 at 12 14 55 pm

Now just launch the app

screen shot 2013-08-12 at 12 02 21 pm

And that's it. I hacked this up on a rainy Sunday afternoon thanks to a headstart with:

Obviously this particular project is quite specific to my use-case; but still open sourced for inspirational purposes.

The first Firefox Phones are targeted at upcoming markets so featurewise can't really compete with - and won't replace - your modernday iOS/Android devices.

However, at just 50$ you do get a considerable amount of hardware:

  • 1Ghz CPU
  • 512 RAM
  • GPS. Wifi N/UMTS/GSM reception
  • 3.5" HVGA touchscreen (!)
  • 3 mega pixel camera
  • Light & proximity sensor. G-Sensor
  • USB
  • 1580 mAh Battery

.. That you can easily talk to via JavaScript APIs. Just imagine what other dedicated applications you could build on top of this :) Be it:

  • a remote controller
  • the brain of a robot that you're building
  • a security device taking pictures when it detects changes in light
  • in your car, uploading G-forces & GPS to track when you've been driving most economically :)

For some things a Raspberry PI or Arduino makes more sense, but since this has a touchscreen, solid housing, extra sensors, and the platform is fully open too, I see a lot of possibilities.

Update #1

The Keon I won will be sold at 91 EUR, not 50asImentioned.However,ZTEwilllauncha79 as I mentioned. However, ZTE will launch a 79 Firefox phone on Ebay this Friday.

Legacy Comments (7)

These comments were imported from the previous blog system (Disqus).

Sergi
Sergi··9 likes

Awesome! Nice to see that the phone went to somebody that really used it! :)

Kev van Zonneveld
Kev van Zonneveld··3 likes

Your talk was extremely inspiring Sergi! Great job - and thank you so much!

adam
adam··2 likes

thanks kevin, thats a nice report :)

TekSwift
TekSwift··1 like

Just read about the ZTE phone on BBC website so googled firefox os apps and found your blog....now I want one just to do these kind of crazy ideas on a wet Sunday Afternoon...GOOD WORK !

Guest
Guest·

Thank, Kevin. I'm learning about mobile apps and this is the first article I read that made me feel like, hey, maybe I can do that. I will start with the very helpful links to Firefox OS Boilerplate and Simulator. ;-)

Rw song
Rw song·

Hi

Dhin Cardoso
Dhin Cardoso·

Kevin! Just three words for you: "You are awesome!"