Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Wordpress developer story
This article describes the Wordpress porting story from iPhone to Qt on Nokia devices.
Wordpress is the number-one open-source blogging tool, used on millions of sites by tens of millions of people every day. A Wordpress application for Nokia devices is being developed on Qt technology to provide support for both Symbian and Maemo™ platforms.
Antti Kosonen from the Wordpress Nokia app development group has participated in development since December 2009 — right from the very first line of code. The basis for development has been the iPhone application that is now being ported to Qt.
Antti summarises the open-source development project in two different phases:
‘To make a long story short, it is easy to keep the original structure of the application when porting from iPhone to Qt. You can directly rewrite the core code to Qt just by looking at the original source’.
He continues, ‘But the user interface framework for iPhone is so device-specific that a complete rewrite has been the only solution. This means that the main efforts needed for porting are focused on the UI’.
Rapid UI development
The Wordpress Qt application for Nokia devices is created by using standard UI widgets on top of the graphics view. Despite the need for a rewrite, Antti has been surprised at how fast the UI development has been with Qt.
‘Compared to many other platforms, tweaking of the UI is incredibly quick. You can set values, launch it on the desktop, and, if it looks good, add to the device style sheet and deploy for verification’.
A great example of this Qt tool chain is the stats view of the Wordpress app. This view was developed entirely without debugging it on the device. It was developed to scale properly on different sizes and fine-tuned with platform-specific style sheets only at the very end.
‘Tools are excellent for this purpose’, says Antti. ‘We were able to develop UI views from mock up to end product using only Qt Creator’.
The Wordpress application is developed with maximum compatibility in mind. According to Antti, the amount of if-defs in the source are kept as low as possible.
‘Yes, Qt is cross-platform to some extent’, he says. ‘As long as classes and functions start with the letter Q, they will most probably work on any device.
‘But there will always be platform-specific issues, too’, Antti continues. ‘For example, the softkey menu in S60 has no similar implementation in Maemo, so it needed to be replaced with its own button in non-S60 environments. This is, of course, related to how strongly you are willing to adapt to the platform's default user experience’.
Because of the differences in target platforms, such as screen size and input methods, application design has a major role in the efforts required for creating cross-platform deliveries. Simple UI design can reduce the workload noticeably.
‘Now that we are implementing a full-screen mode for the application, the softkey issue no longer applies, and there will be one less if-def in the source’.
One of the single most difficult challenges for Antti in the Wordpress Nokia app project has been the issue of the thumbnail grid. The original feature was developed with the iPhone native framework, but Qt on Symbian does not currently provide similar features to fetch image thumbnails.
‘We faced the fact that rendering of each image thumbnail takes 0.2 seconds. That does not sound like too much for a single image, but 100 images will cause a poor user experience’, Antti notes.
‘We are still working on the issue, but were able to make it smoother by limiting the thumbnail rendering only to visible images. I hope to solve [the problem] without native implementation, because of the risk of increasing deployment complexity’.
Still, native code might be the appropriate solution for some issues.
‘When we were running the first versions on devices, there was an issue raised with S60 3rd Edition, Feature Pack 1 devices. They kept asking for an Internet access point for every network request’, Antti explains.
‘We implemented an S60 native functionality to provide a solution to this. It is used only for S60 3rd Edition, FP1 devices, and it works just great’.
Benefiting from the built-in features
Although there are no plans for localized versions of the Wordpress application for Nokia devices, the source already includes support for it. Each of the strings has been described in the code with a simple object, to enable listings of language-dependent strings inside the project. The listing results in an XML file, very similar to one in Xcode.
In general, Antti has been happy with the maturity of Qt.
‘Developing applications for Qt is fun’, he says. ‘The language is straightforward and easy to adapt to’.
Read more on the developer's blog at http://nokiadev.wordpress.com/ or take a tour and compare source codes at http://nokia.trac.wordpress.org (Nokia-device source) and http://ios.trac.wordpress.org/ (iPhone source)
To proceed with porting, check the full porting offering (from iOS/iPhone, Android and Windows Phone) available at http://www.developer.nokia.com/Porting, including
- API Mapping tool: http://www.developer.nokia.com/Develop/Porting/API_Mapping/
- Porting to Qt (from iOS/iPhone, Android and Windows Phone) library: http://www.developer.nokia.com/Resources/Library/Porting_to_Qt/
- Porting code examples: http://www.developer.nokia.com/Develop/Porting/Code_examples/
- Developer experience videos: http://www.developer.nokia.com/Develop/Porting/Videos/
See also Symbian Design Guidelines and Nokia Developer Design and User Experience Library for ideas on how to achieve the best possible user experience when porting your application for Nokia devices.
Copyright © 2010 Nokia Corporation. All rights reserved. Nokia, Nokia Developer, and Maemo are registered trademarks of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Apple, iPhone, iPod and MacBook are trademarks or registered trademarks of Apple Inc. Android is a trademark of Google Inc. Other product and company names mentioned herein may be trademarks or trade names of their respective owners.