How do I

Contents

I want to make an app for N9. How do I...

First steps

... get started?

Download Qt SDK with the Harmattan target, see instructions in Getting started with Harmattan using Qt SDK. You can start developing either by porting an existing application or using the New Project wizard.

For more information on developing Harmattan apps, see Developing for Harmattan. If you want to read more on the hardware and software design and features of Harmattan devices, go to the N9 launch site.

... create an app that can also run on Symbian?

To make a cross-platform capable application, use only those Qt 4.7 and Qt Mobility APIs that are available for both platforms. Use either plain QML or Qt Quick Components to create the UI. Most Qt Quick Components are supported by both platforms. There are also some coding and security considerations to take into account. For more information, see Porting applications to Harmattan.

Nokia Developer site also provides some cross-platform Qt example apps.

User interface

... create an app that uses the native UI widgets of the platform?

Use the QML-based Qt Quick Components as building blocks to create a UI that matches the native look and feel of the Harmattan device. If you absolutely want to use C++, the MeeGo Touch library provides a native QGraphicsView-based widget set.

For more information, see Application development framework and UI design in Harmattan applications.

... implement rotation?

If you use either Qt Quick Components or MeeGo Touch, the framework handles orientation issues for you so that when the user turns the Harmattan device from landscape to portrait or vice versa, the application changes its orientation as well. If you use other UI frameworks, make some changes in the code to implement rotation. In most applications, the UI also looks better if you create a different layout for each orientation to match the shape of the screen. For more information, see Controlling rotation.

... lock screen orientation to landscape or portrait?

If you wish the application to stay locked to the same orientation even when the user rotates the device, do the following:

  • If you are using Qt Quick Components, use the orientationLock property of the Page component. For more information, see MeeGo 1.2 Harmattan API reference.
  • If you are using MeeGo Touch, use the MWindow and MWidget classes in the libmeegotouch library. For more information, see libmeegotouch library in Platform API reference.
  • If you are using other frameworks, see the instructions in Controlling rotation.

Data management

... show my app settings in the device’s Settings screen?

The device's Control Panel contains separate settings pages (called Applets) for each application. The easiest way to create a Control Panel Applet is to use the declarative applet API provided by the libduicontrolpanel library. For more complex cases, you can use the C++ API. For more information, see Creating Control Panel Applets.

... find out where my app stores its data on the device (and what data does it even store)?

To store application data, application settings and state information, either use the available APIs (such as QSettings or QtSQL) or save the data as files in the file system. For more information, see Data storage. Harmattan platform supports the XDG Base Directory Specification.

... make my app regularly check an online repository for upgrade versions?

To make your app wake up regularly from sleep mode to check for updates (or to perform some other activity), use the system heartbeat. The heartbeat wakes up apps that need periodic wake-up calls at the same time. This reduces power consumption. To enable the heartbeat feature in your application, you can use two classes:

  • QSystemAlignedTimer (in Qt Mobility API)
  • QmHeartBeat (in QmSystem API)

For more information, see Using heartbeat.

... provide updates to the events feed while the application is on the background?

Create a scheduled background plug-in to push event updates on the device Events View. For more information, see Integrating event feed into applications.

Communications

... make a phone number in a message into a link that the user can click to make a call or send a message?

Use the .desktop file of your app to define certain URI schemes and MIME types for telephone numbers. For more information, see Launching another application from your application.

... make a web or e-mail address in a message into a link that the user can click?

Use the .desktop file of your app to define URI schemes and MIME types for web addresses and email links. For more information, see Launching another application from your application.

... get my app to read incoming SMS messages?

Use the QtMessaging API to allow your application to show SMS messages.

... utilise Near Field Communications (NFC)?

Use QtConnectivity APIs to interact with NFC Forum Tags and NFC Forum Devices, including target detection and loss, registering NDEF message handlers, reading and writing NDEF messages to NFC Forum Tags, and send tag-specific commands.

Location

... get position data for my app?

Use Location API to use location positioning, landmark management and mapping and navigation functionalities in your application. For Harmattan-specific instructions on accessing positioning data, see Using location and maps in applications.

To find out how to create a simple app that shows your current location on a map, see the location and maps example app.

Usability

... make my application start more quickly?

When creating a new project in Qt Creator with the Qt Quick application template, select the Make application boostable checkbox. Then the invoker program and the applauncherd daemon help your application launch faster and save memory. For more information, see Optimising application startup.

... make the swipe behaviour stop because although it's cool it's interfering with my app's usability?

Use the QML Screen element to disable the swipe gesture. If you disable swiping, make sure that the user has some other way to minimise or exit the application (such as Pause or Minimise button). For more information, see Enabling swipe lock.

... stop my application from updating the screen, playing music, or performing other actions that require heavy processing when the user swipes it away?

Read more about the available visibility states in Application lifecycle.

... minimise my application's power consumption?

Your application’s power usage depends on how well optimised the application is. The more your application does, the more power it consumes. Typically you can tweak power consumption by coding practices, see Optimising power consumption. Use Energy Profiler and PowerTOP tools to measure power consumption.

Publishing

... specify an icon for my application?

Your app needs two separate icons:

  • Package Manager icon: Shown during installation. Define the icon in the control file when packaging your application in Qt Creator. The recommended size is 64 x 64 pixels. For instructions, see Modifying control file in Qt Creator .
  • Application launcher icon: Shown in the application grid on the Home screen. Define the icon in the desktop file of your application. The recommended size is 80 x 80 pixels. For instructions, see Modifying desktop file in Qt Creator.

You may also need graphics with a higher resolution to publish your application in the Nokia Store. For more instructions, take a look at the Nokia Publisher Guide.

... publish my application in Nokia Store?

Package your app as a .deb file. Note that Nokia Store has its own guidelines and entry requirements that your app has to meet. For more information, see publishing instructions for Harmattan applications. You can also take a look at the Nokia Publisher Guide.

Miscellanous

... create applications (daemons) that can be run in the background on the device?

Background applications, or daemons, do not usually require any direct input from the user and are launched when the device is booted. For more information, see Creating daemons.

... get my app to use the Single Sign-On (SSO) capability that Accounts provides?

Use the Single SignOn framework. It provides of a secure storage of login credentials (for example usernames and passwords), plugins for different authentication systems and a client library for applications to communicate with this system.

... work with the device’s volume settings and other resources?

Read Selecting the resource application class for information on:

  • Controlling your game's volume with the device's the hardware buttons.
  • Using the XV port.
  • Getting signaled when the XV port needs to be closed because another application needs it.
  • Not getting your game audio muted when an incoming notification sound is played.

... localise my application?

To find Harmattan-specific information and a simple example of localising a Hello World app to a few languages, see Localising applications. Qt provides general internationalisation and localisation facilities. For more information, see Internationalization with Qt.

Localise your app's name and description shown in the Package Manager and the name displayed in the Applications view of the device. For instructions, see Packaging your application.

I have a question that I don’t see answered here – where do I go next?

Have a look at Qt documentation; the questions and answers on this page are specific to Harmattan, but Harmattan uses Qt, and on the Qt side you will find lots more info.

If you still can’t find what you’re looking for, why not try the N9 Developer blog or the MeeGo discussion board provided by Nokia Developer.