Some of you might be thinking to yourselves: “Why in the world would you re-create functionality that FirefoxOS already ships with?”
Short answer: I’m dumb
Long answer: I don’t think it was around quite as I liked it when I first got my Flame
– I wanted to write something non-trivial (I use that term loosely) in Ember
– I wanted to explore how easy it is to write apps for FirefoxOS and how performant (using the term performant loosely here) they are
tldr; Check out the code here VCFPorter @ bitbucket, there are some bugs, and development will slow for a while, but file issues if you see any!
The app is still under review, but hopefully will be through soon!
Before I delve into the app itself, let me give a little background:
I recently switched from a Samsung Galaxy S4 to a FirefoxOS Flame developer reference phone. While many don’t understand (which I don’t hold against them), I did it for a few reasons:
Pretty much everyone that knows me has looked at my Flame phone at least once, and were surprised to learn that Mozilla even makes a phone. While most don’t see the point, it’s a great chance to explain to them why I’ve made my decision, and why I like the phone so much (sometimes that goes well, sometimes it doesn’t). Needless to say, I love the FirefoxOS Phone (and might be insane).
When I first got my Flame, FirefoxOS (v. 1.3) couldn’t import contacts from my vCard (.vcf) file on my SD Card. When I looked on the app store, I found exactly what I needed in the app vCardIn, but it sadly couldn’t handle the version of vCard that I was using.
At that point, the realization hit me — If the app I wanted didn’t exist yet, I could just build it, and then it would! While most see a relatively-small ecosystem of apps as a pain, I saw it as an opportunity to have fun, build something relatively interesting, and contribute to FirefoxOS, so I did.
When I was thinking of what technologies to use on the project, I remembered hearing/reading about EmberJS a while ago and really wanting to give it a try, so I put myself up to learning and using EmberJS to build the app.
At the beginning, I tried to make the smallest-codebase solution I could, slowly rolling in (and being forced to roll in) things like RequireJS and Handlebars, but soon I switched over to using Ember-CLI (which is now the recommended way to use EmberJS). While it increased complexity quite a bit, it was well worth the switch, as things went a lot smoother after switching to using Ember CLI and I have not looked back since.
My thoughts on Ember & Ember CLI
Ember is a very rails-y. While most might like this kind of thing, I’m actually not a huge fan of rails, because I think it’s too heavy. After using Rails for a while (and doing migrations between Rails 2/3/4, I found myself feeling somewhat restricted and sluggish using Rails and I hoped that feeling wouldn’t be my experience with Ember.
Luckily, it wasn’t. Though Ember CLI does a fair bit of “magic” to get everything to work together nicely, it’s not very much magic. so it’s actually fantastic.
My opinion doesn’t count for a whole lot, since I’m relatively new and this app is a not huge or really complex, but I enjoyed using Ember (with Ember CLI) very much on this project, was a joy to have things Just Work™.
My thoughts on FirefoxOS
As one might expect, I don’t have any bad things to say about FirefoxOS here. While there are some spots in the app that you can tell that one of the actions freezes the whole app, the experience is relatively speedy, and performs well.
It was a breeze to make the app, and most of the complexity I faced was self-inflicted.
My thoughts on building a cross-platform app
While I’ve always pondered what it would take to build an app that would work on a platform like FirefoxOS along with a web browser, this app was a good chance to put some of my assumptions to the test. All it took to make the app cross-platform was to do a little platform detection, and make a basic structure for calling functions customized for the possible platforms (code in cross-platform.js). While this might sound tedious, it also enforced me to very clearly specify my API, and made it very easy to see what platforms supported which functions
This was a blast. I’m releasing it with a few bugs, and a lot of enhancements that could be made, but I think it’s still a nice little app for showcasing how one can use EmberJS on FirefoxOS.