You Are Here:

Community: Blogs

Vinod Kumar K V's Forum Nokia Blog

DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 24 February, 2007 14:26

In this blog entry I would like to share a small utility class, which is nothing but to find the Phone/Network/Subscriber related information in a synchronous way. In Forum Nokia Technical Library there is already a tip for finding the IMEI number in synchronously, you can find it here. I've just used that approach here to find these details:

  1. Phone information: manufacturer, model and serial number (IMEI). You've to basically use the CTelephony::GetPhoneId() API to get these information.
  2. Network information: cell id, location area code, country code etc. (this can be extended, check the SDK Help of CTelephony for that). With CTelephony::GetCurrentNetworkInfo() API you can gather the network related information. Notice here you need a ReadDeviceData capability for accessing this function.
  3. Subscriber information: subscriber id (IMSI). The CTelephony::GetSubscriberId() API will help you retrieve this information.

All the above functions are not synchronous so to make it synchronous the work-around is the use of CActiveSchedulerWait. After the call of these asynchronous and SetActive() you have to call a iActiveSchedulerWait->Start() and in your RunL() you have to check whether the iActiveSchedulerWait is already started with iActiveSchedulerWait->IsStarted() if then stop by iActiveSchedulerWait->Stop(), then fetch the information. Get to know more about this please refer this example: DevInfo_3.x.

Please check my comments below for more clarity. 

EDIT: Changed the article name (previously it was Get the IMEI of a 3.x device) and added a more elaborated and extended example. Changed the CDevInfoAppUi::ShowNetworkInfo() as mentioned by 'operelstein' in his comment and updated the latest link for the example to download.

RSSComments

1 2 3  Next»

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

fagiano | 01/03/2007, 14:33

Hi,

The example is great. I try making the same to return Mobile Country Code, but without success.

Do you think is it possible or not?

Bye, Luca

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 02/03/2007, 17:58

vin2ktalks Hi Luca,

Thanks for your comment. I created another samlpe and I'll be putting the link in the article later. These are my observations.

1. The CTelephoney::GetCurrentNetworkInfo() API needs a ReadDeviceData capability.
2. My new example I tested with N73 and E61. In N73 the application has shown both the phone related and network related information but on E61 I got only phone related information. I guess the reason is E61 is faster in performance comparing to N73, so that it got the information fast. So I think the async method of finding the network info is recommended in those scenarios.

-- vin2ktalks

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

fagiano | 07/03/2007, 14:01

Hi Vinod,

Now it's ok. I was wrong because I added the capability to a dll which makes the synchronous call
instead of adding it to the gui app which load the dll.

Could you please briefly explain how CActiveSchedulerWait can make the synchronous call?

If I'm not wrong, the active scheduler implements an event loop that waits on the thread's request semaphore, and when an event is received, invokes the active object's RunL() method.
Now with CActiveSchedulerWait::Start and CActiveSchedulerWait::AsyncStop we start and stop a new loop. What happens different from asynchronous case?

Why, for example, couldn't we use WaitForRequest(TRequestStatus) ?

Thanks a lot for your availability

Bye,
Luca

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 07/03/2007, 14:21

vin2ktalks Basically the User::WaitForRequest() is an alternative for the AO, in certain situations. But the main draw back of User::WaitForRequest() is that it'll block the execution of further code as well as it will block the UI too so the better solution would be AO especially if the execution time is more.

Now in an AO when ever we send a pending request that will be processed in the background without blocking the other threads. So by using a CActiveSchedulerWait::Start() inside an AO (it may not be always inside an AO) the further line would be executed until if we explicitly stop the CActiveSchedulerWait object by calling CActiveSchedulerWait::AsyncStop(). In the example what I did is basically after calling each SetActive() started the CActiveSchedulerWait. Now the control will come to the next line only when the RunL hit and we called CActiveSchedulerWait::AsyncStop(). I hope you understood now.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

mirza.daud | 23/03/2007, 06:09

Hi vinod,

Can you plz tell me why my application is not opening but it is coming to the menu pane.I am developing the application for s60 3rd edition.I am waiting for your suggestion.

Thanks,
Mirza

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 26/03/2007, 17:44

vin2ktalks Hi Mirza,

Please verify whether you've signed the SIS file with a developer certificate. If you've already signed with Dev certificate then did you able to get any panic code and on which device did you test it?

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

raul.cicero | 29/03/2007, 13:09

Hi,

I have take a lok to your example, it's really interesting. I have installed on a phone and checked that worked, after this, I tried to call if from my own application, instantiating the CDevInfoUtil class and calling it, but the application crashes, I just tried to get the network information.

I have another active object on my application, but it's not instantiated at any moment, perhaps I have some dll on the link path that makes conflict, but I can't find the problem.

Please tell me what information can be useful to check my error or if you have some idea I can check.

In fact I'm searching for the national prefix of the phone, but the one I've found in CLocale is put by the manufacturer and is not the real one (at least in my case), I've found a table from MCC to Country and another one from country to national prefix, but I haven't found a pre-built one, but continue searching.

Thanks in advance.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 30/03/2007, 18:34

vin2ktalks Thanks for using this example. I would like to know what kind of a panic/crash note which you were getting. Another thing is with out seeing the actual code snippet it's very difficult to say something.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

raul.cicero | 31/05/2007, 19:42

Hi again, sorry for the very late response...

My problem was already solved, it was in fact a capability that was disabled (I was sure I have checked all of them).

Thanks for answering.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

fagiano | 16/04/2007, 18:59

Hi Vinod,

I don't try to return currently network type (GSM-UMTS). Using iMode = iNetworkInfoV1.iMode; and
iAccess = iNetworkInfoV1.iAccess; I respectively have ENetworkModeUnknown and ENetworkAccessUnknown. I have the documentation's required capabilities (ReadDeviceData - Location), infact I can obtain all others networks info like

cell id: iNetworkInfoV1.iCellId;
mcc: iNetworkInfoV1.iCountryCode;
network display tag: iNetworkInfoV1.iDisplayTag;

What about in your opinion? Could it be a capability lack?

Thanks,
Luca

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 17/04/2007, 16:31

vin2ktalks Hi Luca,

I don't think it is a Capability issue. I'm not much aware of why it's giving that as an output. I checked with th SDK Help and it says:

ENetworkAccessUnknown: This is used when there is no network activity and therefore no RAT active.
ENetworkModeUnknown: Network mode is unknown.

Did you try the same with any other network?

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

fagiano | 17/04/2007, 18:32

I only tried with Nokia 3250 and GSM network (it doesn't support UMTS).

I read SDK, but what does "no RAT active" mean? Because I can receive and make call, so there is "network activity"....

Thanks

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

hrshirazi | 02/05/2007, 19:08

Hi

I am trying to get the IMSI number from a pc connected to a phone by Bluetooth. Assuming that I am using a Nokia N73, I would like to ask you if there is any API or code snipper in Java which could sort out my problem.

Just out of curiosity, is there any way to send a command (ATplus commands) remotely from PC through Bluetooth and get the IMSI from the mobile phone ? --- It is very desire for me to acquire this information with minimum use of mobile resources.

Any comments are welcomed.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 07/05/2007, 12:30

vin2ktalks Hi hamid,

First of all I'm not a Java/J2ME expert; secondly you may be better ask this question on the discussion board (http://discussion.forum.nokia.com/forum/forumdisplay.php?f=3) to get a prompt reply. Initially whenever a new comments added I used to get a notification mail, now a day that is not happening. That is the reason for this delayed reply.

Any way I don't know is there any way to get IMSI through Bluetooth AT Commands that too using J2ME. May be a work around would be create a C++ application which can fetch the IMSI number from the device. Then either you can send that information to a J2ME application or send it through Bluetooth Serial Profile to a PC.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

siddharthraob | 14/05/2007, 12:55

Is there any way I can get My Devices' Own Number (Self Number)??
Did try the "Mobinfo 3rd Party Telephony" Library, for devices based on Symbian OS v7.0, v7.0s, v8.0a, and v8.1a. However that has failed to give me the results.
I am looking at solutions for the 2nd Ed phones too, which are not supported by the CTelephony class.

Thanks
Siddharth.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 14/05/2007, 14:11

vin2ktalks Hi Siddharh,

Similar kind of questions have been already asked on Forum Nokia Discussion Board several times. As of now this is not possible as the SIM card doesn't hold the mobile number. This is one of the post which is talking about the same issue from Forum Nokia: http://discussion.forum.nokia.com/forum/showthread.php?t=106465.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

ash_21 | 14/06/2007, 14:27

Hi Vinod,
I am ashfaque from Pune. I am new to the symbian programming. I just want to ask u if I am right then u've developed this code for 3rd edition. I m doing this program for 2nd edition. If u have this program for 2nd edition pls send me to ashfaque.ht@gmail.com. I m in urgent need of this. Pls send me if have or tell me some of the quidelines abt this program. I have developed this program but there is not proper API present in 2nd edition therefore I m getting lots of linker errors.
I m waiting for your reply. I hope you will guide me in this problem.

Regards,
Ashfaque

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 14/07/2007, 16:14

vin2ktalks Hi Ashfaque,

Sorry for the delay in publishing your comment. From the last one month I was bit busy.

By the way right now I don't have any code for 2.x with me. I hope you would have managed to get one during this period.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vish382 | 17/08/2007, 12:07

CAN NOT BE INSTALLED ON NOKIA N 80 ERROR CERTIFICATION , WHY?

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 17/08/2007, 14:56

vin2ktalks First of all two suggestions
1. Avoid using CAPS, as it's used for shouting in internet.
2. Before commenting it would be always better to read the previous comments.

Well, any way you may have to sign the sis file with a developer certificate, the sis file which is provided is not a signed one.

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

nick_santa83 | 11/09/2007, 18:48

hi, Can i check with you if python can extract cellid infor from 2nd edition 3rd FP phones such as N70? I could not find any infor on this. thanks:)

nick

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

vin2ktalks | 11/09/2007, 19:14

vin2ktalks Hi Nicholas,

I'm unaware of that, I haven't yet tried Python. I hope some one from Forum Nokia Discussion Board may help you on this matter.

How to write the info got from DevInfo in the phone

TAPAS KUILA | 03/11/2007, 11:25

Sir, how to store the info jsut got from the DevInfo app, say I want to store the CellId & NetworkID, CountryId etc data in a file say:
"C:systemDevinfo.txt"
How can I do that? where in the example code do I have to change the lines?Which lines do i have to change/insert?
And do I need to change any existing capabilities in the Symbian SDK?ReadDeviceData/WriteDeviceData, etc??

Lastly, how to make the above DevInfo code to run for Symbian S60 3rd Edition Phones?(I have N70, so I can check it only on emulator, not only the real phone)

GetCurrentNetworkInfo After Specific Intervals

Srikanth.P | 16/11/2007, 14:11

Hi Vinod Thnks a lot Code is great, I needed something like this,I'm developing tracking application in S60 3rd Edition for which i need network info continously say TowerID every 1 minute,I've used RTimer::After(status,60000000) for 1 minute delay and CTelephony in RunL() hers my code of RunL,Application is terminating Abruptly,Can U pls see whats wrong with the code.

void CActive1::RunL()
{
if(state==1)
{
state = 2;
telephony->GetCurrentNetworkInfo(iStatus, networkInfoPckg);
SetActive();
}
if(state == 2)
{
state = 1;
aImsi.Zero();
_LIT(KCellId,"TowerId:");
aImsi.Append(KCellId);
TUint iCellId;
iCellId = iNetworkInfo.iCellId;
aImsi.AppendNum(iCellId);
_LIT(KNewLine,'n');
aImsi.Append(KNewLine);
_LIT(KAreaCode,"AreaId:");
aImsi.Append(KAreaCode);
aImsi.AppendNum(iNetworkInfo.iLocationAreaCode);
CAknInformationNote* informationNote1 = new (ELeave) CAknInformationNote;
informationNote1->ExecuteLD(aImsi);
iTimer.After(iStatus,30000000);
SetActive();
}
//SetActive();
/****/
}//RunL()

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

Satish | 20/12/2007, 14:29

Hey hi when i am new to Symbian .. I just downloaded ur sample .. ran the BUILDTARGET I get the following Error
Clean previous build if any . . .
"Start build for GCCE . . .
Start create SISX . . .
Processing DevInfo.pkg...
DevInfo.pkg(7) : error: number out of range
Press any key to continue . . ."

Can u help me out ??
Thank You in advance
Satish TJ

web services in 3rd edition

Bhausaheb Gurav | 24/12/2007, 07:19

I want to know how to get the support for implementing web services for 3rd edition

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

Satish TJ | 29/12/2007, 12:53

Hi Vinod ,
I have played around with ur code very much now :)

Here are some problems I encountered

1> When I use buildTarget
I get a warning saying

>>WARNING: Cannot determine the version of the RVCT Compiler.
WARNING: When building for ARMV5 platform Compiler RVCT2.2 or later is required

And subsequentl I get error

But I created a Developer Certiciate and signed the DevInfo SIS
... Wow it works ...

Then I took this app n went around in bangalore .. but The Location Id and cell ID reamined the same .. which was very dissapointing :( Is that an expected behaviour ??Kindly answer

Then I tried my luck by replacing source from Carbide ..( Created new project and made same source files n altered the UID suitable) It works with emulator .. of course( some dummy values I think) .. Then I also tried to get the think running for GCCE
release .. but when i installed n ran the app , it went blank .

Saw throug forums it says Uid shoud be some ox103 ... something but the UID u have used i some 0xE ...

Looking fwd for ur reply

Thanks in advance
Satish TJ

Is it Possible to Find SIM number with IMEI number

Surya | 07/01/2008, 11:18

Hi,

This is Surya, i have a doubt that is , is it possible to find sim card number with the help of imei number.

if any possible... pls send me the answer to srkmsc@gmail.com.
thanks
surya

CDevInfoAppUi::ShowNetworkInfo()

operelstein | 19/03/2008, 11:08

Vinod,

It seems that the addresses of cellid and lac variables are shown in the Network Info dialog instead of their values.

The following replacement in CDevInfoAppUi::ShowNetworkInfo() method should be done to fix this:

networkInfoBuf.Format(KNetworkInfoFormat, &cellId, &locationAreaCode, &countryCode);

replaced with:
networkInfoBuf.Format(KNetworkInfoFormat, cellId, locationAreaCode, &countryCode);

Please check this out. And thanks a lot for the great example anyway.

Best wishes,
Oleg.

Nothing shown?

rudyanto | 10/04/2008, 11:57

Hi, I've downloaded your example code and been playing with getting network info, etc. I signed your app with the developer certificate, indicated "ReadDeviceData", "ReadUserData" in the request and managed to install the SIS in a Nokia E65.

And it runs fine. But when I selected "Phone info" or "Network info" or any other selections in the main menu, no data is shown. For instance, there's a dialog box with "Phone info" as a its header but the body is empty. Do you know what's happening here?

Am I supposed to sign it with more permissions? I'm just starting to switch to Symbian after many years doing J2ME work.. Any help appreciated!

works on another phone

rudyanto | 10/04/2008, 12:28

Further to the earlier post, I tried installing your app on another phone, Nokia N73. It works... I wonder if E65 has an issue with CTelephony?

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

JanM | 22/04/2008, 16:38

hi vin2ktalks,
i dont have problem with using CTelephony class,but i cant find long time how can i get Signal Level(not Strength in DBm,i need Signal/Network Indicator)...can you help me with this pls or can you add some example here?

thanks very much for every help...
best regards

Signal Level

JanM | 22/04/2008, 16:40

i was talking about S60 3rd symbian generation..

Retrieving the installed software properties(software version,name,other details) from mobile number

azar_sheik | 01/09/2008, 15:42

Hi,is it possible to retrieve the installed software details(version no,name,expiry date,etc) using C++ api,as per my knowledge all the software details get stored in Application Manager of the mobile device.i m developing an application which need to fetch these details from mobile device.I got the API's to retrieve the phone's properties like IMEI,IMSI,battery level.PLease let me know if any methods are available for this operations.

Problem in N95

AsharSalman | 04/11/2008, 14:06

Hi, I am new to Symbian. I tried to use your application, downloaded it and open signed sis file with ReadDeviceData capability. It intalled and opened but did not show any information except the white boxes. Every option results in for example;

----------------------------|
|Phone Info |
| |
| |--------------------| |
| | | |
| | //white box | |
| | | |
| |--------------------| |
| |
|---------------------------|
OK Cancel

N95 is 3rd Ed FP1. Can you help?
Thanks
Ashar

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

MatthiasStevens | 20/11/2008, 17:13

I also get the white empty boxes. I signed the sis with Open Signed (with all capabilities checked) and I using a Nokia 6220 Classic (S60 3rd Ed. FP2).
Any ideas?

get imsi in 2 nd edition

komalagarwal | 25/12/2008, 16:25

hey vinod sir
i am newbie in symbian
i wanted to know how can we get imsi for all 2nd edition devices below 2nd edition fp3
so plz do reply to me
i am in serious need

socket programming

hrishi_24h | 23/02/2009, 09:06

Hi Vinod Sir,

I studied your code example of getting cell id, imei number.
It was nice and helped a lot.
I am developing application which requires socket programming.
please suggest different API's to use. if you have any code example please send it to me.
I am newbie in symbian, so please guide me.

password protected application

jffrsn_20 | 27/02/2009, 08:37

Sir, nice blog! very helpful.
sir, can you gave me sample code or idea on how i will make my application be password protected? will i need a databased here? how? what db will i used? how do i store my password?

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

missmè | 10/03/2009, 14:14

hi, can you guide me to get imsi or imei code using midle that accessind to the native method. I use nokia n82 ...
Thanks in advance...
Please help me...

Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.

ocean9000 | 02/04/2009, 17:43

how we can get 3 CELL ID (at least) NO JUST ONE !

I saw this question many time , any one can answer please

What if the messaging server or the network search is not up?

Vink | 15/05/2009, 17:30

I am trying to run that code as soon as the phone boots. It is possible that the messaging server is not yet up or the network is not setup by the time my code executes. What does these API return?

What happens in that case?

Regards,
Vink

Only white blank page is coming for N95

firzhan | 15/09/2009, 22:00

Hi,

I used ur same sis file and did certify it. I used the N95 for testing purpose.

But after launching the application it only showing the empty white square. But in emulator it is working perfectly
(By displaying the default values)

You must login to post comments. Login
 

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: qdcZidentifierQSxhttpE3aE2fE2fblogsE2eforumE2enokiaE2ecomhttpE3aE2fE2fblogsE2eforumE2enokiaE2ecomE2findeE78E2ephpE3fopE3dViewArticleE26blogIdE3d18771E26articleIdE3d421E26E26X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZBlogContentQ qdcZtypeQUqfntypeZBlogE45ntryQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fFNE2d1E2fBlogTopicE2fgeneralX qfnZtopicQUqfnTopicZcppQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZBlogContentQ qfnZtypeQUqfntypeZBlogE45ntryQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxs60X qfnZuserE5ftagQSxsymbianE2dcE2bE2bX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZBlogContentQ qrdfZtypeQUqfntypeZBlogE45ntryQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ