You Are Here:

Community: Wiki

This page was last modified on 28 September 2009, at 07:05.

Get MCC MNC in Qt for Symbian

From Forum Nokia Wiki

(Redirected from Get MCC MNC in Qt)
Reviewer Approved   


ID ... Creation date June 26, 2009
Platform S60 3rd Edition, FP1, FP2
S60 5th Edition
Tested on devices Nokia 5800 XpressMusic, Nokia 6720 classic
Category Qt for Symbian Subcategory


Keywords (APIs, classes, methods, functions): XQSysInfo::mcc(), XQSysInfo::mnc()

Overview

This code snippets shows how to get MCC and MNC from device in Qt. Basically IMSI is 15 digits long 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). So retriving MCC and MNC from IMSI is not always safe, thus implemented this method to get MCC MNC from CTelephony::GetCurrentNetworkInfo() API of symbian.

This snippet requires ReadDeviceData capabilities. Self-signing is not possible because a Developer certificate is needed.

Prerequisite

Note: These files are extended from source file of XQSysInfo API. More clearly , i have just edited some file of XQSysInfo API to get MCC and MNC. XQSysInfo::mcc() return MCC and XQSysInfo::mnc() return 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 \
-lfeatdiscovery
 
symbian:TARGET.CAPABILITY = ReadDeviceData

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

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

Image:ImageMccMnc.jpg

Download Code Example

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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTalkE3aE4cargeE5fscreenE5fsaverX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ