Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
This page was last modified 17:10, 16 February 2008.

Reading IMSI in 3rd edition -Synchronously

From Forum Nokia Wiki

IMSI stands for "International Mobile Subscriber Identity".


IMSIApp.h

#include <e32base.h>
#include <Etel3rdParty.h>
 
class CIMSIApp : public CActive
{
	private:
		void ConstructL();
		CTelephony* iTelephony;
		CTelephony::TSubscriberIdV1 iSubscriberIdV1;
	        CTelephony::TSubscriberIdV1Pckg iSubscriberIdV1Pckg;
	
	public:
		CIMSIApp(TDes& aIMSI);
		static void GetIMSI(TDes& aIMSI);
		TDes& IMSI;
 
	private:
    /*
       These are the pure virtual methods from CActive that
       MUST be implemented by all active objects
       */
		void RunL();
		void DoCancel();
};

IMSIApp.cpp

#include "IMSIApp.h"
 
void CIMSIApp::GetIMSI(TDes& aIMSI)
{
	CIMSIApp* self= new (ELeave) CIMSIApp(aIMSI);
	CleanupStack::PushL(self);
	self->ConstructL();
	CleanupStack::PopAndDestroy(self);
}
 
void CIMSIApp::ConstructL()
{
	iTelephony = CTelephony::NewL();
	CActiveScheduler::Add(this);
 
	iTelephony->GetSubscriberId(iStatus,iSubscriberIdV1Pckg);
	SetActive();
	CActiveScheduler::Start();
}
 
CIMSIApp:: CIMSIApp(TDes& imsi): CActive(EPriorityStandard),IMSI(imsi), iSubscriberIdV1Pckg(iSubscriberIdV1)
{
	//default constructor
}
 
void CIMSIApp::RunL()
{
	if(iStatus==KErrNone)
	{
		IMSI = iSubscriberIdV1.iSubscriberId;
		CActiveScheduler::Stop();
	}
}
 
void CIMSIApp::DoCancel()
{
	iTelephony->CancelAsync(CTelephony::EGetSubscriberIdCancel);
}

Now do the following steps:
1) Create a sample "Hello World" type application.
2) Put IMSIApp.h file in your application's "inc" folder.
3) Put IMSIApp.cpp file in your application's "src" folder.
4) Open .mmp file and add entry SOURCE IMSIApp.cpp.
5) Open .mmp file and add entry LIBRARY etel3rdparty.lib.
7) Now you need to include following header in your class to read IMSI:
#include "IMSIApp.h". Let's say in for e.g.: "CYrAppUi.h"
8) You can then call the static function from any of your Commands.
For ex: in your CYrAppUi.h you need to include "IMSIApp.h"
And Call it like:

case EReadIMSICommand1:
{
     TBuf<25> iIMSI;
     CIMSIApp::GetIMSI(iIMSI);
     CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
     informationNote->ExecuteLD(iIMSI);
}

9) Open .mmp file and add entry CAPABILITY ReadDeviceData.
10) You need to sign resulted .Sis file with your developer certificate to get it installed on your phone.

You can find a working application which is built in MS 2003 IDE with Carbide.vs Support.
Here it goes: [Read IMSI]

See Also

Related Discussions
Thread Thread Starter Forum Replies Last Post
S60/E61 HelloCarbide Installation (Beginner) rtrnokia Symbian Tools & SDKs 4 2007-01-04 13:32
symbian 3rd edition sis pv123 General Symbian C++ 17 Yesterday 12:16
custom navipanel in 3rd edition symbianyucca Symbian User Interface 0 2006-05-23 07:36
s60 3rd edition ... help ? dakoz General Symbian C++ 2 2006-11-15 15:13
always on top icon on 3rd edition devices saji_iq Symbian User Interface 5 2007-09-27 23:37
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX