02 June 2013

Firefox OS App Workshop

Yesterday I took part in a second Firefox OS event organized in Warsaw. It was really worth it, considering all attendees received a free Geeksphone Keon device to develop their apps. 


At the previous event (Firefox OS App Days) there were no existing devices to work with. We had to make do with the early version of Simulator extension for Firefox browser. There wasn't much information about app development as well.

This time it was a lot better. A few months of work introduced many improvements in OS Simulator, made it faster and removed some pesky bugs. Huge effort has been also put in developer documentation and example applications. Finally we now have real devices to target and to test with. You can tell this project is really important to Mozilla.

The device

I won't talk much about Keon's marketed features as there is already a couple of reviews on the Net. The most unexpected feature of this phone is a really fast boot process. No Android device I've seen can compete. Keon is really underpowered and it has to heave Firefox-based operating system. Still it performs really well.

Another nice feature is support for adb from Android world. It's a side effect of using some Android pieces (kernel and HAL as far as I remember). You get root shell access without any rooting process (no cracking, re-flashing, exploiting). It's a welcome surprise, just like with the N900.
From the same category the phone supports unlimited USB tethering (besides standard Wi-Fi hotspot). It works even without debugging being turned on, unlike in my Android phone.


As for the operating system the app installation and removal process is one of the best features. Removing apps works just like under iOS. But what's more you can install apps from the Marketplace, developers' websites or even "pin" mobile sites to your desktop. This means any well designed site can be turned into installable (yet online) application. It's really important because Firefox OS is suffering from every young platform's issue -- small number of apps in the official app store.


Last but not least the map application is really great. As far as I know it's based on Nokia maps (their here service). It's fast (in download speeds) and responsive. The maps are aesthetic and truly readable even considering small size of phone's display. There are also multiple layers -- satellite view, traffic, etc. Pretty much all standard features. Although I haven't found a way to use map data in your own applications (like in Google Maps or Open Street Maps). 

Workshop

I've entered the venue with my coworkers from Apphance, some ideas for apps in our heads and only a stub of HTML5 application. We've decided to create a geo-aware note taking app. Then the planning begun. A few application screen have been designed and we proceeded to implement them. Unfortunately we have hit many issues that slowed down our development. 

First of all Firefox OS has no way to remote debug your application during development. This was previously possible with Developer tools but has been since disabled for security reasons. I've tried to fall back to using Weinre but it crashed under Firefox, so had to alt+tab between Firefox window with the Simulator and Chrome window with Weinre. Possibly due to wireless client isolation in the venue I couldn't run Weinre on the device itself. Too bad, debugging with alerts. 

There is also a peculiar quirk with the current version of the OS. After pushing the app to your phone you have to reboot the device. Otherwise the application won't show up on the desktop.
What is more, sometimes we got the impression app is not properly updated on our Keons. So we had to push it, manually close it and reopen by tapping the icon. It gets tiresome, especially in comparison with Android/iOS development. It's probably best to debug on Simulator and only use your device for APIs absent in the browser.
When we started to use Geolocation API in our app, both the Simulator and Keon asked every time for permission approval, even if I marked the option to remember my choice. So probably another well-hidden bug.

All in all this was however a really fun experience. We've managed to do two user visible screens -- using Backbone.js for application structure and Twitter Bootstrap for the styling. Local Storage has been used as a persistence layer. After long struggle we've decided to avoid Backbone's routers and just wire up our views in a pseudo application object. You can see the source at Github (disregard the readme file). This is by no means a finished application, just a few hours work. By adding some event triggering and handling we can make it pretty usable.


The whole event has been well prepared, informative and just great to experience.
All that is left to say:
I support the Open Web


No comments:

Post a Comment