Note: To complete this tutorial, you must install the Qt Quick Components for Symbian and the Symbian^3 tool chain as part of the Qt SDK. In addition, you must install the Qt Quick Components on the test device.
This tutorial describes how to use Qt Creator to create a small Qt application, Battery Status, that uses the System Information Mobility API to fetch battery information from the device.

The user interface for the application is designed using Qt Quick Components for Symbian. This enforces a platform look and feel for Symbian^3 devices.
Note: Targets are listed if you installed the appropriate development environment, for example, as part of the Qt SDK. You can add targets later in the Projects mode.
Note: Qt Creator contains a default program icon and generates an Application UID, for testing the application on a device. You only need to change the icon and UID if you deliver the application for public use.
Qt Creator generates the necessary files that contain boiler plate code. The wizard creates an application that uses page-based application navigation.
Modify the files as described in the following sections.
To use the Qt Mobility APIs or develop applications for Symbian devices, you must modify the .pro file to declare the Qt Mobility APIs that you use.
This example uses the System Info API, so you must declare it, as illustrated by the following code snippet:
CONFIG += mobility MOBILITY = systeminfo
Each Mobility API has its corresponding value that you have to add as a value of MOBILITY to use the API. For a list of the APIs and the corresponding values that you can assign to MOBILITY, see the Quickstart Example.
The wizard adds the import statements for Qt Quick and the Qt Quick Components for Symbian to the MainPage.qml file:
import QtQuick 1.0 import com.nokia.symbian 1.0
To use the Qt Mobility APIs, you must add the import statements for the Qt Mobility APIs that you use. This example uses the System Info API, so you must import it, as illustrated by the following code snippet:
import QtMobility.systeminfo 1.1
Use the values as you can assign to MOBILITY also to construct import statements.
Qt Creator generates a default QML file that you can modify to create the main view of the application. It displays a progress bar and a text label that indicate the battery status.

button.To fetch the battery status, open MainPage.qml in the code editor and add some code to it:
Page { id: mainPage DeviceInfo { id: deviceinfo Component.onCompleted: { deviceinfo.startBatteryLevelChanged(); } onBatteryLevelChanged: { progressbar1.value = batteryLevel } }
Text { id: text1 x: 0 color: platformStyle.colorNormalLight text: qsTr("Battery status: %1%").arg(progressbar1.value) anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter font.pixelSize: 20 }
ProgressBar { id: progressbar1 anchors.horizontalCenter: text1.horizontalCenter anchors.top: text1.bottom anchors.topMargin: 20 minimumValue: 0 maximumValue: 100 value: deviceinfo.batteryLevel }
Now that you have all the necessary code, select Qt Simulator as the target and click the
button to build your program and run it in the Qt Simulator.
In Qt Simulator, run the runOutOfBattery.qs example script to see the value change in the Battery Status application. Select Scripting > examples > runOutOfBattery.qs > Run Selected Script.

You also need to test the application on real devices. Before you can start testing on Symbian devices, you must connect them to the development PC by using a USB cable and install the necessary software on them.