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. Thanks for all your past and future contributions.

Archived:How to read IMEI in Qt application for Maemo 5

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The IMEI should be accessed using the cross platform Qt Mobility API QSystemDeviceInfo

Article Metadata
Created: divanov (09 Feb 2010)
Last edited: hamishwillee (11 Oct 2012)

Archived: This article shows how to use the Maemo 5 DBus interface for obtaining IMEI of the phone.

The name of a service is, a path name is /com/nokia/phone/SIM/security, an interface name is Phone.Sim.Security. Finally the method's name responsible for obtaining IMEI is get_imei

You can verify that it works using dbus-send utility in XTerm:

dbus-send --system --type=method_call --print-reply \ \
/com/nokia/phone/SIM/security \

Now how you do it with C++ and Qt. First you need to create an interface on system bus identified by service/path/interface triad. A next step is to perform a method call to obtain a reply. Note that the call is synchronous, i.e., blocking. This is simple example and lightweight call, for more serious tasks use QDBusAbstractInterface::callWithCallback(). Reply contains string and integer value. The former represents IMEI of the phone.

#include <QApplication>
#include <QLabel>
#include <QDBusInterface>
#include <QDBusMessage>
#include <QDebug>
#define SIM_DBUS_PATH "/com/nokia/phone/SIM/security"
#define SIM_DBUS_IFACE "Phone.Sim.Security"
#define SIM_IMEI_REQ "get_imei"
int main(int argc, char *argv[])
QApplication a(argc, argv);
QLabel label;
label.setFont(QFont("Nokia Sans", 35, QFont::Bold));;
QDBusMessage reply =;
if (reply.type() == QDBusMessage::ErrorMessage)
qDebug() << reply.errorMessage();
else {
QList<QVariant> args = reply.arguments();
qDebug() << args;
label.setText(QString("Phone's IMEI: %1").arg(;
return a.exec();
This page was last modified on 11 October 2012, at 01:18.
63 page views in the last 30 days.