6Dec/117
A MeeGo developer’s endeavors to the Symbian Qt world
I've been working with Qt for a while already and we all know what a great cross-platform framework it is. When Nokia bought Trolltech in 2008 it was clear that Nokia wanted to make Symbian development easier. However, the QWidget based toolkit would not fly on Symbian, or any other mobile platform for that matter, so Nokia built some mobile UI frameworks on Qt (and oh boy Nokia is good at building frameworks for everything. Everyone should have at least one framework, if not two. I could write another blog post about that...). But while people in Europe were fighting over their frameworks, it was not until the guys and gals in Brisbane came up with QML when everything changed. Qt could finally be cross platform again and in an elegant way! Symbian just isn't my cup of tea. But that doesn't prevent me from wanting to write something for Symbian if for nothing else other than being able to say I've done it. But just thinking of Symbian C++ or Avkon makes me feel sick. This has changed thanks to QML and especially Qt Components. Also Nokia has finally been able to put out a single SDK that I can just install, write Qt with, deploy the same code on any Qt-based Nokia mobile, publish in the Nokia Store and... Profit! Right? Well, my opportunity to find out came now thanks to my podcast application, Podcatcher for N9, that I've written for the Nokia N9 smartphone. It's has a MeeGo Harmattan Qt Components based UI with a Qt C++ middleware. These are my comments as a former MeeGo developer on the journey to the Qt world of Symbian.And so it begins

Qt Components to the rescue
I really really like QML and Qt Components. It's such an elegant solution to a complex problem. This is why I was so excited to check out how easily I could get Podcatcher for N9 running on Symbian. And to make the story short, I can already let you know that it worked out pretty well. But there's always the one 'but'. Nokia is a big company and you can see it in Qt Components. It's a reflection of when business units inside Nokia have to work together to create a unified developer experience and a cohesive API. In the end to see what they've done I am impressed. But below are some examples of API differences in Qt Components between MeeGo and Symbian and I can't come up with any other explanation for these differences other than there were two separate set of people working on them. In MeeGo you put ToolIcons inside a ToolBarLayout, in Symbian you put ToolButtons. In MeeGo the icon is defined with iconId, in Symbian with iconSource. In MeeGo you show a InfoToolbar with show(), in Symbian you show it with open(). In MeeGo you can define for how long it is visible, in Symbian you cannot. I can't see any technical reason for these differences. I would love to hear the reason for these differences if anyone has some inside information or has some other rational explanation for that matter. When you realize these kind of differences, your excitement over a promise of a cross-platform development platform, based on Qt Components, starts to fade away a bit. You still remember the crash I talked about earlier? Well, it came back to haunt me. Every now and then when I open a QML page (without any C++ code that is being executed, I might add) the app crashes. I also want to point out that I simply cannot get the same QML and C++ code to crash on the N9. It's then when my good buddy Zchydem shared his experience with Symbian and pointed out again the variable TARGET.EPOCHEAPSIZE to me. He also had random crashes if that value "wasn't high enough". So this time, instead of commenting out the variable altogether, but that got me on the right track, I put some values there that I got from Zchydem. TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 in fact. I can only assume that there is now some magic maximum value Symbian is allocating for the heap. And look and behold - the app doesn't crash anymore (at least as often)! This leads me to believe that there are memory management issues in QML with Symbian when pushing and popping Pages from the pageStack and when you do this long enough (or fast enough) your device simply runs out of memory or corrupts its memory stack. Last but not least I must also tell you that the QueryDialog has a bug in Symbian. It will truncate the text you give it, no matter how long it is, if you don't add extra line breaks ('\n') at the end of the texts in the dialog.Conclusion
I think the best way to summarize my experience with Qt on Symbian is to say "Not as bad as I though it would be, but had more bugs and issues than I hoped for". I am happy that I've done it, Podcatcher (that will be renamed in Nokia Store) runs quite nicely now on my Nokia C7 although it is seemingly slower than on the Nokia N9. Most of the work in porting was related to the lack of truly cross-platform Qt Components, random crashes that were impossible to debug properly, but also to the fact that the screens are different on the N9 and the Symbian^3 devices so adapting your layouts is just necessary. I wanted to avoid duplicating the QML files for Symbian, but this was impossible to avoid. There were just too many layout changes, missing Qt Components or components that had different API.Β Qt Components (version 1.1 I might add) is not cross-platform between Symbian and MeeGo. Period.
However I was happy to notice that absolutely most of the C++ code was running fine on Symbian without any need for modification and this alone is evidence that Qt on Symbian is a huge leap for Nokia to the right direction!
To have a nicely running Podcatcher for N9 from MeeGo on Symbian Anna took me from start to finish some two days working on-and-off. It's not that bad, but considering how cross-platform Qt Components and the SDK could be made, it should be better. Would I do it again? Probably not on my spare time. But I could do it again if necessary since Qt on Symbian is not really that bad π
Next
Podmaster is on its way to Nokia Store for all those millions of Symbian Anna and Belle devices as as soon as I get a new icon with a transparent background. So go get it then! π In the meantime I'll continue writing some more with this same theme. In my next blog post I want to dig deeper into the details of what I did to have Podcatcher for N9 run on Nokia C7 and Symbian Anna and in general what I think are the necessary steps in general to have a MeeGo Qt Components based application run on Symbian. Until then, thanks for reading!-
KΓΆntzΓ€
-
Johan Paul
-
-
Anonymous
-
Johan Paul
-
-
Arun
-
Johan Paul
-
-
Spencer Harry