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.

Get MCC MNC in Qt for Symbian

From Wiki
Jump to: navigation, search

This article shows how to reliably get the phone MCC and MNC from Symbian device using a Qt Mobile Extension. Note that at time of writing (Qt Mobility 1.0) this article has not been superseded by the Qt Mobility API because even though the MCC and MNC can be derived from the IMSI (QSystemDeviceInfo:imsi) this process is not reliable.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic, Nokia 6720 classic
Platform(s): S60 3rd Edition, FP1, FP2
S60 5th Edition
Platform Security
Signing Required: DevCert
Capabilities: ReadDeviceData
Keywords: XQSysInfo::mcc(), XQSysInfo::mnc()
Created: savaj (26 Jun 2009)
Last edited: hamishwillee (11 Oct 2012)

The IMSI is a 15 digit number. The first 3 digits of IMSI are the MCC, and is followed by the MNC, either 2 digits (European standard) or 3 digits (North American standard). Because the MNC length may differ, getting the MCC and MNC from IMSI is not always safe. The code given gets the MCC and MNC from the Symbian CTelephony::GetCurrentNetworkInfo() API.



Note: These files are extended from source file of XQSysInfo API. I have edited some file of XQSysInfo API to get MCC and MNC. XQSysInfo::mcc() return MCC and XQSysInfo::mnc() returns MNC.

Headers required

 #include <XQSysInfo>

.pro file

All source files are automatically added to .pro file by carbide, so need to add the libraries and capability only.

symbian:LIBS += -letel3rdparty \
-lsysutil \
-lefsrv \
symbian:TARGET.CAPABILITY = ReadDeviceData


XQSysInfo *sysInfo = new XQSysInfo(this);
/* show MCC on label */
ui.label->setText("MCC: " + sysInfo->mcc());
/* show MNC on label */
ui.label_2->setText("MNC: " + sysInfo->mnc());


The code snippet is expected to show MCC MNC on screen as showm bellow.


Download Code Example

  • The Code Example will show MCC and MNC on screen and is tested on Nokia 5800 XpressMusic.
This page was last modified on 11 October 2012, at 01:16.
73 page views in the last 30 days.