Comments, Code and Qt. Some words about the wonderful world of software engineering

26Jun/1114

What is the developer story for the Nokia N9?

The MeeGo Harmattan powered Nokia N9 has now been out for a couple of days. Nokia's developer pages has a whole section dedicated to the Nokia N9 and we also have some great UX guidelines available. But as an app developer I am really just interested in writing my code and deploying it on to the device or the emulator. I already wrote earlier that the "official" developer story around Qt SDK 1.1.2 did not work for me and I am still wondering if this approach will work really well in Windows and OS X. I have also read the blog post from Nokia Developer's Kate Alhola on how to develop Qt Component apps for MeeGo Harmattan in Ubuntu without Scratchbox. This lead me to conclude that Nokia now has at least three ways how developer can develop apps for the Nokia N9 and all of them have some issues.  All of these approaches are also described on pages that are hosted and maintained by Nokia which adds to the confusion.

Qt SDK 1.1.2 and QEMU

This is the official developer story that is being advertised on developer.nokia.com. And it's a fine story too. There's only one SDK package to download and it's available for Windows, OS X and Linux. Nokia says it's still beta so you need to enable the Harmattan deployment target manually when updating the latest modules, but that's fine - I got everything installed ok on both Windows and Linux. But sadly it seems this approach doesn't work at the moment (as I mentioned in my previous writing) out of the box. Whenever I launch an app with the Harmattan target, I only get an error saying that QEMU is not running. So I abandoned this approach pretty soon and looked into Scratchbox.

Scratchbox and Xephyr

This is the approach I wrote about earlier. It has been described in the Wiki section of developer.nokia.com. Scratchbox will give you a sandboxed environment that simulates the device environment together with a cross-compilation toolchain. Once you have it up and running - and got used to Scratchbox - it's probably the preferred way of developing for Harmattan. Harmattan is a Linux based OS anyway and you'll have native debugging and analyzing tools available. And running the Harmattan environment in Xephyr is pretty decent. But this solution will only work in Linux. I would even say that it will only work without hitches in a Debian based Linux. It's also not as convenient as having one integrated IDE solution for all your developer needs. As a bit of speculation, I would guess that this situation is also one of the reasons for Nokia moving to Windows Phone; MeeGo has yet to offer a complete developer package with all the tools integrated to an IDE. Windows Phone has this, but for Harmattan, Scratchbox is your best solution. And it's not that convenient if you are not used to it.

Qt Components development in plain Ubuntu

As Kate Alhola describes in her blog post, you can also do Harmattan Qt Component apps in plain Ubuntu Linux. Setting up the development environment required just installing a few packages from the Nokia Developer's own Debian repository. You could write your apps in plain Ubuntu, run them as you would any Qt Quick based application in Qt Creator and last deploy them on your device by compiling the app either in Scratchbox or in Qt Creator Harmattan target. There are a few gripes I have with this approach. Why aren't the packages that Kate referrers to available in the Scratchbox environment and in the repositories it uses? Not to mention Qt SDK installation. It feels like a totally separate approach to anything else what Nokia is telling us about Nokia N9 development. Also, it is unclear to me how you would actually use the MeeGo Harmattan platform services with this approach. You probably could do simple Qt Quick UI apps, but anything requiring Single-Sign On, the Tracker or any of the Qt Mobility APIs would be out of reach for you. And lastly, this approach sure doesn't make app deployment any easier.

Conclusion

So what is the developer story for the Nokia N9? There seems to be at least three ways how you can create your app for the Nokia N9. But which one is the best one and which one is officially supported by Nokia? It seems the official one with Qt SDK and QEMU is flawed from the start with QEMU. The one that involves Scratchbox seems to work best for Linux users, but it's not available on other platforms and is not officially supported by Nokia (or...?). The last with plain Qt Quick apps but with Harmattan Qt Components that Kate Alholas describes seems like a loosely added third way "just because you can" that takes away all Harmattan platform services from you. So what is the developer story for the Nokia N9? Disclaimer: I did work for MeeGo Harmattan and I intend to use the Scratchbox approach also because it is familiar to me. I think it works the best from all of these approaches. When you get used to it, it's a pretty decent environment. My only criticism is that Nokia has communicated three ways of developing apps for the Nokia N9 and the official one is flawed.

Technorati Tags: , , , , ,

  • Adrien Bustany

    If you’re lucky enough to have a device, you can configure qt-creator to use it instead of qemu, and it works like a charm… I ran into the same issue as you did with qemu not launching, hopefully that will be fixed quickly.

    • Nice to hear that the experience with a real device is better – and probably THE preferred way if you have one.

      I got QEMU running from Qt Creator (read my yesterday’s blog post about it), but it is painfully slow and at least on my Linux box not usable at all.

  • Ville Vainio

    Did you try simulator? (not qemu, the Qt SDK Simulator)

    • Hmm. I don’t see that available in the Harmattan target. How would I do that?

      • Ville Vainio

        Add a new target, Simulator.

        • Adrien Bustany

          Looks like the qt configuration is slightly different there though, I get “module “QtQuick” version 1.1 is not installed”

  • Ville Vainio

    BTW, I find scratchbox workflow horrible (I’m addicted to being able to build, run and debug the code directly from the IDE where I’m editing it). Simulator and desktop Qt work much better in that regard, and since you are on linux anyway you have all the tools at your disposal (we even have sp-rtrace and sp-smaps-analyze packaged in fn-ppa repo).

    You lose the ability to use harmattan specific features and API’s, but only a small percentage of apps needs those – especially as we want as many apps as possible to remain compatible with Symbian.

  • I had the same qemu issue. I’ll be documenting it in a blog post, but you need to make sure the “Qt version” isn’t the “Platform SDK” (which you don’t have installed), but instead the “Qt SDK one”

    More details at http://mg.pov.lt/meego-irclog/%23meego.2011-06-22.log.html#t2011-06-22T11:57:42

    There are lots of papercuts around this (e..g qtc_packaging/debian_harmattan shows up in the Projects explorer, but qtc_packaging/debian_fremantle needs adding manually; the .desktop file got out of sync, and didn’t show up automatically) and the qemu approach is far too slow to be useful (even when you change the OpenGL mode to “hardware”, because “automatic” used “software”)

    The qemu approach (given it’s cross-platform) has the *promise* of being the best way, but the qemu performance needs an enormous boost.

    • I also had to go to “Tools > Options… > Maemo > Maemo Device Configurations > Harmattan qemu” and increase “Connection timeout” to 300s, otherwise the build & deploy step doesn’t complete before it wants to start the app.

    • Adrien Bustany

      I haven’t tried the qemu method myself, but is it using kvm? Or is it just slow because of the opengl emulation?

      • Dunno if it’s using kvm. How’d I check?

      • It seems unlikely as I assume it’s emulating ARM, and my host is x86. KVM (AFAIK) only gives virtualisation benefits when the guest and host are the same architecture.

        • Adrien Bustany

          Oh yeah, if it’s emulating ARM then it’s definitely not using KVM. I wonder why they don’t have an i386 target…