I'm a Symbian C++ developer, I develop applications for S60. I'm here to share some of my thoughts, experiences, and know-how related to the mobile application development. Thanks for bearing me.
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:
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.
General, S60, Symbian C++ |
Next |
Previous |
Comments (43) |
Trackbacks (0)
vin2ktalks | 02/03/2007, 17:58
fagiano | 07/03/2007, 14:01
vin2ktalks | 07/03/2007, 14:21
mirza.daud | 23/03/2007, 06:09
vin2ktalks | 26/03/2007, 17:44
raul.cicero | 29/03/2007, 13:09
vin2ktalks | 30/03/2007, 18:34
raul.cicero | 31/05/2007, 19:42
fagiano | 16/04/2007, 18:59
vin2ktalks | 17/04/2007, 16:31
fagiano | 17/04/2007, 18:32
hrshirazi | 02/05/2007, 19:08
vin2ktalks | 07/05/2007, 12:30
siddharthraob | 14/05/2007, 12:55
vin2ktalks | 14/05/2007, 14:11
ash_21 | 14/06/2007, 14:27
vin2ktalks | 14/07/2007, 16:14
vish382 | 17/08/2007, 12:07
vin2ktalks | 17/08/2007, 14:56
nick_santa83 | 11/09/2007, 18:48
vin2ktalks | 11/09/2007, 19:14
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)
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()
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
Bhausaheb Gurav | 24/12/2007, 07:19
I want to know how to get the support for implementing web services for 3rd edition
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
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
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.
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!
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?
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
JanM | 22/04/2008, 16:40
i was talking about S60 3rd symbian generation..
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.
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
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?
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
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.
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?
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...
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
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
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)
Re: DevInfo - Get the IMEI, IMSI, CellId etc., synchronously on 3.x devices.
fagiano | 01/03/2007, 14:33
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