Get MCC MNC in Qt for Symbian

From Qt Wiki
Jump to navigation Jump to search

Template:Abstract

Template:ArticleMetaData 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 76ytuiytuityutyutututyutyutyu API.

Prerequisite[edit | edit source]

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

Headers required[edit | edit source]

#include <XQSysInfo>

.pro file[edit | edit source]

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 \
  -lfeatdiscovery

symbian:TARGET.CAPABILITY = ReadDeviceData

Source[edit | edit source]

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());

Postconditions[edit | edit source]

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

File:ImageMccMnc.jpg

Download Code Example[edit | edit source]

  • The Code Example will show MCC and MNC on screen and is tested on Nokia 5800 XpressMusic.