[Ubuntu QML] SimpleToDo.. done!

Last week I wrote about my first impressions on working with QML vs Android as I tried to translate a SimpleTodo application.

This week, I managed to find a few more spare hours to finish it. Not only that, but I have been able to go beyond what I had for Android. Specially on the UI part, QML makes it really simple to build in transitions and animations. I also found that defining States for the application had simplified the complexity of the program.

I don’t think that today there are official menus published for Ubuntu qml components, so I have implemented my own menu “a la” Ubuntu for phones. Here is a small video of the app:

or you can access the link here: http://www.youtube.com/watch?v=T-gDv-vDMhg

Overall, I highly recommend everyone to play with QML. Here are two very useful links if you are new to it:

And of course, lets not forget the awesome developer.ubuntu.com pages!

[Ubuntu QML] ToDo Android vs Ubuntu

A few months back, I decided to write a Simple ToDo app for Android, then I hooked it up to a cloud backend, using Juju. That was my first Android application, so I got to experience first hand the latest developer documentation and development environment.

Last month, Canonical launched Ubuntu for Phones, that gave me the idea to re-write the same application on QML using the Ubuntu Components.

Clearly comparing a new SDK-Alpha with a stable platform like Android will seem hardly fair, however, keep reading as you might be surprised of the results.

QML vs Dalvik Java

Lets start with QT/QML vs Dalvik/Java – I found QML really easy to get to grips with and be productive. I had the UI (see picture below) running in no time and I would say much faster than with Android.  QML is a very flexible declarative environment that allows you to embedded quick logic into the layout. This is a blessing and  a curse.

While with Android, it was very easy to keep a nice MVC  separation, I struggled to stop the leaks in QML. So while it is very easy to quickly write a functional application, it does not impose what you would consider as good development practices.

In summary, they are both very powerful development environments.


IDE: Eclipse vs QtCreator

Part of the development experience is the IDE. I must say that I simply love the QTCreator. Possibly not as polish as Eclipse but you don’t need to read a manual to use it. Also, with a quick integration with the HUD, it is just very simple to use.

So what is QTCreator missing? A good emulator. The Android Development Kit (ADK) provides a really good user experience to develop mobile solutions. QMLScene gives you similar functionality but does not simulate a phone environment. However, all the technology is there, and  I am sure that will be included in the v1.0 version of the SDK.


I can’t fault Android developer documentation, but taking into account its popularity, you  wouldn’t expect anything else.

I was very surprise of the quality of information on http://developer.ubuntu.com/ and specially with the component showcase.


The only thing to watch out for is that in Android you can get all the info you need from a single website. With QML you quickly end up pinging between Digia, Nokia and Ubuntu pages.

The Code

The code is on my launchpad repos. The actual source functionality is not finished as I am still trying to figure out how to add menu options to access Done items. Anyway, the whole thing is pretty compact compare to the Dalvik code. The actual logic is almost identical in both. A ListView that is populate from an List model. All the data is persisted in SQLite db.


Both environments have been equally painless to work with, the difference is that the Ubuntu environment has *just* been released as an Alpha. I think this is the start of a very vibrant App development ecosystem.

[Ubuntu Nexus7] Keeping up with progress

To make it easier to keep up with the work and progress on the Nexus 7 , I have set up a topic in status.ubuntu.com and a wiki page with the performance goals for the release:

If there is  a missing Blueprint that should be track under this topic, please let me know.


[Ubuntu Nexus7] 7 hours battery life whilst browsing

I stumbled upon a Chrome OS test case that includes a chromium-browser extension that simulates user browsing. The extension does a 1 hour test split by:

  • [First 60% of the test] Browsing: a new website is loaded every minute.  The web page loaded is scrolled down one page every second, then scrolled back up one page every second.
  • [Next 20%] Email: Gmail is loaded in the foreground tab and audio is streamed from a background tab.
  • [Next 10%] Documents: Various Google Docs are loaded.
  • [Final 10%] Video: A full screen 480p YouTube Video is played.

Besides the fact that the audio requires flash, everything else worked in the Nexus 7. After a few tweaks to the extension, I had it running on a loop for 24 hours. Also, I changed it so the auto-browsing would start as soon as you launch chromium.

The next thing to do was to write a simple bash script that would launch the browser and log battery life and screen brightness to a file every 15 min. The assumption was that as the system run out of battery it would shutdown, and that last entry in the file would give me the battery life whilst browsing.

  • Battery levels can be read from here (thanks ogra!): /sys/class/power_supply/battery/capacity
  • Brightness levels can be read from here: /sys/class/backlight/pwm-backlight/brightness

I set it to run overnight at a screen brightness of 99. The good news is that the system suspended rather than just run out of juice at about 4:51 AM (according to the browser history).  3 hours later, I resumed it to find it in a good state.

All and all – the Nexus 7 with Ubuntu was browsing for just over 7 hours (7 hours and 12 minutes), so I am pretty happy with that. Although, for any reliable benchmarking, I would need at least 10 samples of the test run. If you want to check out the test, you can find all the code here: http://bazaar.launchpad.net/~vtuson/+junk/load_test_nexus7/

Here is a graphical representation of the results:

The brightness “auto-dim” was a bit disappointing, not to say erratic, and I have filed a couple of bugs against it.

[Ubuntu Nexus 7] Browser Performance

I decided to run some browser performance benchmarks from http://peacekeeper.futuremark.com/ in the Nexus 7 running Ubuntu, mainly to see how it compares with other platforms. Here are my basic conclusions as a result of the test:

  • In general Ubuntu + Nexus 7 performs pretty well
  • The Nexus 7 with Ubuntu and Chromium (629) performs better that the Android Nexus 7 (489)
  • Firefox performance (257) is pretty bad compare with Chromium (629). I have tested it in my laptop and the same different exist, however the more powerful hardware makes it not as relevant.

Unfortunately, I wasn’t able to access the detailed results (it displays blank), any suggestions why? My results are the bottom firefox (257) results, and the top Chrome (629):