MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

Porting applications to Harmattan

This section provides information on how to port applications, which were developed for other platforms, to MeeGo 1.2 Harmattan. The links in this page are either inside the Harmattan Developer Library or they lead elsewhere, for example, Nokia Developer.

When porting applications to Harmattan, consider if porting or reimplementation is the best approach. For example, it is often feasible to reimplement the user interface (UI), because of differences in UI technologies. The recommended UI framework for Harmattan is Qt Quick Components with Qt Meta-Object Language (QML). If you are unfamiliar with QML, see QML documentation.

For more general issues, especially when porting from Symbian, see the Introduction section of Porting Symbian Qt Apps to Nokia N9.

When porting to Harmattan, the following areas usually require attention:

For more information on the available UI frameworks, see Application development framework.

Porting from Symbian to Harmattan

For instructions on porting Symbian Qt applications to Harmattan, see Porting Symbian Qt Apps to Nokia N9. Qt documentation also provides a walkthrough guide on porting a Symbian example application to Harmattan. For more information, see Qt Developer Guides.

When porting from Symbian to Harmattan, consider the following issues:

  • If your Symbian application uses Qt Quick Components, see the MeeGo 1.2 Harmattan and Symbian Qt Quick Components comparison table.
  • If your application uses Qt WebKit or plain QML without Qt Quick Components, see Example of wrapping a web application into QML.
  • If your application uses QWidget-based UI components, the best approach is to rewrite the UI. The use of QWidgets is not recommended in Harmattan applications, because the UI elements are too small and not suitable for touch-screen interaction.
  • Harmattan does not support widgets, that is, small applications that are constantly visible on the screen. However, you can integrate events feed into your application to provide information on the device desktop.
  • Make sure that your software performs optimally on Harmattan devices and delivers a great user experience. See Performance testing tools.
  • Size of the display: On Symbian devices the resolution is usually smaller than in Nokia N9. In general, you need to make the graphics bigger and optimal for touch-screen use.
  • In some cases the sensors and their behaviour is different between Symbian devices and Nokia N9. N9 is a touch-only device with no hardware keys except for audio volume and power, whereas the number and layout of keys on Symbian devices varies a lot.
  • Orientation changes and other integration with the UI framework of the system: the Harmattan windowing system does not rotate the application. The application must use Qt Quick Components, for example. For more information, see Controlling rotation.
  • See Nokia N9 UX Guidelines.
    • There are no close buttons in Harmattan applications. Instead, you use the swipe down gesture or close the applications in the task switcher.
    • The Component Library in the UX Guidelines gives excellent examples of the available components.
  • Application lifecycle and visibility: Make sure that your application follows the Application lifecycle guidelines.
  • Harmattan uses Qt version 4.7.4. Note that there might be differences in Qt Mobility and Qt Webkit between different versions of Qt.
  • Packaging and desktop integration of the application is different on Harmattan compared to Symbian. See Packaging your application for more information.
  • There are differences in platform security between Symbian and Harmattan. See Harmattan security.

Porting from Maemo 5 to Harmattan

Changes between Maemo 5 and Harmattan are listed in the section Changes since Fremantle.

When porting from Maemo 5 to Harmattan, consider the following issues:

  • Even though there are several shared APIs between Maemo 5 and Harmattan, Maemo 5 does not support Qt Quick Components.
  • Harmattan does not support GTK+. If you are porting a GTK+ application, rewrite the UI.
  • If your application uses QWidget-based UI components, the best approach is to rewrite the UI. The use of QWidgets is not recommended in Harmattan applications, because the UI elements are too small and not suitable for touch-screen interaction.
  • Harmattan device has a capacitive display, the N900 utilises a stylus and a resistive display. Make sure that the UI elements are large enough to be used with a finger.
  • There are differences in sensors, for example, N900 does not have a magnetometer sensor. Also the behaviour of the sensors such as default refresh rates can be different. N9 is a touch-only device with no hardware keys except for audio volume and power.
  • See Nokia N9 UX Guidelines.
    • There are no close buttons in Harmattan applications. Instead, you use the swipe down gesture or close the applications in the task switcher.
    • The Component Library in the UX Guidelines gives excellent examples of the available tools.
  • Orientation changes and other integration with the UI framework of the system: the Harmattan windowing system does not rotate the application. The application must use Qt Quick Components, for example. For more information, see Controlling rotation.
  • Application lifecycle and visibility: Make sure that your application follows the Harmattan Application lifecycle guidelines.
  • Make sure that your software performs optimally on Harmattan devices and delivers a great user experience. See Performance testing tools.
  • Debian packaging and desktop integration is fairly similar on Maemo 5 and Harmattan. However, you need to create a different set of Debian packaging files, desktop files and icon files for both platforms due to the small differences. For example, the Maemo 5 desktop icon size is 64x64, whereas Harmattan size is 80x80 pixels. See Packaging your application for more information.
  • Maemo 5 does not have a platform security framework. For information on the Harmattan security framework, see section Harmattan security. The Aegis manifest file is generated automatically in most cases, but sometimes you need to need to add tokens manually when porting.

Porting from iOS, Android or Windows Phone to Harmattan

Nokia Developer provides the following porting guides:

UI conventions

Coding considerations

When porting applications to Harmattan, it is recommended that you define the Harmattan scope in the project file. See the RentBook example application.

QMake defines the following for .pro files:

MEEGO_VERSION_MAJOR     = 1
MEEGO_VERSION_MINOR     = 2
MEEGO_VERSION_PATCH     = 0
MEEGO_EDITION           = harmattan

Use the flags as follows:

contains(MEEGO_VERSION_MAJOR,1): ...
contains(MEEGO_EDITION,harmattan): ...

For C++ code, the new #define directives are in qplatformdefs.h (MEEGO_VERSION_MAJOR, MEEGO_VERSION_MINOR, MEEGO_VERSION_PATCH, and MEEGO_EDITION_HARMATTAN). For example:

#include "qplatformdefs.h"

#ifdef MEEGO_EDITION_HARMATTAN
…
#endif

Instead of Qt:WA_* attributes to manage screen orientation, define the orientation with Qt Quick Components (PageStackWindow, Page). For further information, see Controlling rotation.

Security considerations

According to MeeGo 1.2 Harmattan security framework, applications must announce the possible protected resources they require and provide. These protected resources are listed in the Aegis manifest XML file. If you use the Qt SDK, the file is generated automatically when you build the application. For further information, see Harmattan security.

Example applications

Nokia Developer provides cross-platform Qt example applications that have been ported to Harmattan.