Developing QML Application on Symbian

I have never developed anything on Symbian platform and the reason for this is that I couldn’t care less about the Symbian before. I have always been more into about Qt and gadgets that run Linux rather than Symbian.

Now the things have changed a bit – it’s possible to develop Qt applications for Symbian platform which makes  easier to start app development on Symbian for me as a Qt developer. The other reason is, thanks to Qt Ambassador program, that I happen to own N8, which btw is a pretty good HW. To be honest, I can’t praise much the UX on N8, but still, it’s a good hardware.

So I have spent couple of evenings to getting familiar with Symbian development. The most natural way to start it (for me) is of course trying to port QuickFlickr for N8. Before writing more stuff, here’s the video where I run the latest version of QuickFlickr with new UI on N8.

If you wonder, what’s the d-pointer at the start of the video, I have moved QuickFlickr development to the d-pointer. So from now on, d-pointer is responsible of the future of the QuickFlickr. Btw, QuickFlickr on the video is still under work, so it’s missing quite a lot of features.

NOTE: QuickFlickr is not available for N8 yet, but d-pointer will release it at some point at OVI Store FOR FREE. As you probably know the official version of Qt 4.7.x is not available for N8 yet.

New UI? Why?

As you can see from the video, the QuickFlickr runs only in portrait mode and there’s nothing left from the old UI. The reason for this is that, the old UI wasn’t very good. I decided to throw away all the old views and rewrite them from scratch. In my opinion the portrait orientation works best, if using only one hand and as you can see from the video, it works pretty well using thumb only.

Symbian Development

As I mentioned, I haven’t done anything related on Symbian before, but now I have a proper HW to test Symbian development so I decided to give it a try. Of course d-pointer has a goal to make applications available from OVI store, and N8 is already there in the market so it is a good starting point.

Setting up the NokiaQtSDK

To start to develop on Symbian, the easiest way to do it is to install :

  • OVI Suite to Win/PC
  • NokiaQtSDK to Win/PC
  • APP_TRK on device (similar to mad developer for N900)
  • Qt 4.7 developer packages on device and for SDK

As being a newbie in a mystical symbian world it took me some time to figure out how to install these mystical sis files on device. For example if downloading sis files via device browser, IMHO is that it should start an installer automatically.

After this basic setup, I had Qt 4.7 on device, but not in my SDK env. So by following these instructions I managed to create Qt 4.7 target for Qt creator.

Porting Qt/QML Application to Symbian

Usually, when developing with Qt, you don’t need to do much modifications to the existing code/project in order to make your app run on a new platform. With this I mean that in many cases compile-and-run is all you need to do. This was not the case with Symbian.

I wasn’t aware of a resource management on Symbian platform. If your application needs network or certain amount of memory, you need to define those in your project’s pro file using TARGET.<Some Symbian Specific Option> syntax for qmake. If you create Symbian application project using Qt Creator, it adds default Symbian platform related parameters to the generated pro file.  If you are porting an existing application, you need to add these manually. For QuickFlickr I set the following values:

    TARGET.CAPABILITY += NetworkServices
    TARGET.EPOCHEAPSIZE = 0x20000 0x4000000

The first line enables network for the application. It took me a little while to figure you why QNetworkReply’s data was always empty and the reply status was also ok i.e. no error indicated. Only adding NetworkServices to the capability fixed that problem.

The second line defines the amount of memory QuickFlickr needs. Without this line QuickFlickr ran out-of-memory because it loads quite many images, but the default value for max memory was not enough.

By default the orientation changes are handled automatically. If you want to disable that to either landscape or portrait, it requires only a few lines of code.

So as you can see, you may need to do minor modifications for your application’s pro file in order to make it run on Symbian.

Problems with Qt 4.7 for Symbian

Qt 4.7 for Symbian is a developer version so it’s not even expected to work as a charm, and yes, there were problems.

The first problem was that QuickFlickr uses QtWebKit to finalize the authentication with Flickr. The Qt 4.7 developer package for Symbian is somehow broken so it wasn’t possible to run QML/Qt application using Qt Webkit on device. There is a bug about it and it’s fixed, but it would be nice to get fixed developer package too.

I also noticed some weird behaviour which happened only on Symbian. As you could see from the video, in the startup page, the white rectangle was drawn on top of images when Pathview’s delegate uses rotation and items are moved along the path.

It would be nice to get an error if your application is trying to use network e.g. QT +=  network is in a pro file, but no TARGET.CAPABILITY += NetworkServices. Also QNetworkReply should return an error code in this case. Now it just indicates that everything is ok.

I know there is an experimental way to setup the development environment for Symbian in Linux, but I’d like to see OS X support too. Another thing that is a bit annoying, is the requirement for OVI Suite. At least, I needed to install it in order to make Qt creator to find the device that was connected via USB.

Even though the basic SDK setup is quite easy, Nokia could improve the documentation a bit. As I stated earlier, I’m not familiar with Symbian so it took a little time to figure out what is the correct way to install Qt developer package to the device.

Good Things about Qt Development for Symbian

In general, I think bringing Qt to Symbian is a giant leap forward. There are so many Qt developers atm, that starting to develop on Symbian doesn’t require much effort if you know Qt.

The basic SDK setup was easy, which is a big plus especially when comparing what it used to take  to install Maemo development environment few years ago.

I believe that if Nokia plays its cards well, there will be more Symbian app developers than before. As a developer, I think the biggest challenge is to improve the Symbian reputation more attractive somehow. Nokia could also sponsor more small companies or individuals to create content to the OVI store. I believe, Nokia is already doing that, but personally I don’t know any developer who would have said any positive comments about Symbian. (This is the bad reputation that I was talking about…)

I was afraid that the same bug that was preventing to test QuickFlickr on N900 would exist on N8 too. Luckily it wasn’t around on Symbian so big plus for that. The bug was that when images are loaded over the network, at some point loading gets stuck probably because of background threading bug.

So the first impression of developing Qt application for Symbian was mostly positive. What I would like to see is the official support for running development environment on Linux and OS X. That’s still the biggest obstacle for me to start serious Symbian development.

Thanks for reading my blog!

Tags: , , , , , ,

2 Responses to “Developing QML Application on Symbian”

  1. toninikkanen says:

    Interesting read. Did you happen to encounter any problems using the GestureArea element on Symbian (or are you using it at all?)

    Of course you know you could use the Remote Compiler feature for building Symbian apps on Mac/Linux but it’s not perfect..

    • zchydem says:

      @toninikkanen I don’t use any gestures atm, only a MouseArea with onClicked/Pressed/Released. For QuickFlickr I guess the multitouch gesture (pinch?) could be used for zooming at some point, but I try to keep this this app very simple.

      And about the remote compiler, I’ve heard about it, but I haven’t tested it yet. Maybe for the next article then.

Leave a Reply

You must be logged in to post a comment.