(Redirected from N9DevelopmentTipsAndTricks)

N9 Development - Tips and Tricks

From Nokia Developer Wiki
Jump to: navigation, search

This article contains information, tips and tricks for N9 application developers which cannot be yet found in the exiting documentation.



There are number of information sources for N9 application developers. You should start by checking our the Reference documentation and UX Guidelines. In addition there are quite active developer discussions in Nokia Developer forums (here), MeeGo forums (here and here), and Maemo Talk - TMO (here).


Application icon in Application Grid / Home

The application icon size is 80 x 80 pixels, even though the Harmattan App Wizard in Qt Creator 1.1.2 suggests you to use an icon size of 64 x 64. N9 icon guidelines and templates

Application icon in Package Manager

When the application is installed, Package Manager (Application Manager) shows a short description of the application and application icon. All this information is stored in the control file. The size of the application icon shown here is 64 x 64 pixels and it should be stored as Base64 encoded in the field named "XB-Maemo-Icon-26" in the debian packaging control file (in app wizard applications stored in "Other files"/"qtc_packaging/debian_harmattan".

Locking the UI orientation

This can be easily done using Qt Components (Page allows you to lock the orientation). However, be aware of bug #231: your application using Qt Components will be redrawn in portrait mode in the task switcher, if the keyboard is closed.

If your application is not built using Qt Components and QML, consider rewriting your UI with QML, as that is the recommended UI framework.

If that is not an option, reconsider.

If UI rewrite is absolutely out of the question, note that "view.setAttribute(Qt::WA_LockPortraitOrientation, true)" does not work. You could experiment with MeeGo Touch framework (deprecated) or wrapping your UI with QGraphicsProxyWidget, but you might end up having difficulties with event propagation or with virtual keyboard orientation.

Disabling the Swipe


See this example.

Catching the swipe signal, example can be found here (between lines 464-493).

Integrating with system

Events feed integration

There are two libraries available for posting to the event feed:

Creating a single instance application

Currently Qt Creator uses incorrect approach to create single instance application. One can successfully create single-instance application using Harmattan SDK and this approach.

See more discussion in here.

Uninstallation of the application

The system does not close the application running on the background when the user uninstalls the application. If the application needs to handle these situations gracefully a preremove/postremove script needs to be used. <more information later>

Accessing HW

Accessing FM receiver

There is built-in FM receiver in the device (uses headset as antenna), however it is not possible to control the receiver with Qt Mobility API. One needs to access the HW directly.

Accessing FM transmitter

Even though there is built-in FM transmitter inside the device, there is no transmission antenna, so FM transmission does not really work


Testing your application in QEMU

How to start QEMU

System hacks

For experienced users only. If you do not know what you are doing these hacks could possibly brick your device.

Enabling home screen rotation

Described in MeeGo forums by xfade. Enables rotation of the three home screens (events, applications, open applications).

Described in MeeGo forums by nikrolls. Enables rotation of the lock screen.

Article Metadata
Tested with
Devices(s): N950, N9
Platform(s): Meego 1.2 Harmattan
Created: hartti (24 Jul 2011)
Last edited: hamishwillee (13 Jun 2012)
This page was last modified on 13 June 2012, at 13:56.
99 page views in the last 30 days.