And if you are using Symbian 9, you are need to use Telephony API: CTelephony::GetPhoneId(TRequestStatus &aReqStatus, TDes8 &aId) const; Interesting that getting imei in Symbian9 require the CAPABILITY ReadDeviceData.
CGetIMEI::~CGetIMEI() { Cancel(); // Cancel any request, if outstanding // Delete instance variables if any iTimeWaster.Close(); if ( iTelephony ) { delete iTelephony; } }
void CGetIMEI::StartL() { Cancel(); // Cancel any request, just to be sure iState = EGetPhoneInfo; CTelephony::TPhoneIdV1Pckg phoneIdPckg( iPhoneId ); iTelephony->GetPhoneId(iStatus, phoneIdPckg); SetActive(); // Tell scheduler a request is active iActiveSchedulerWait.Start(); }
Hi in the following code const TPtrC CGetIMEI::GetIMEI() method returns an pointer sohow can i display the IMEI on my phone,can anyone suggests iam appending IMEI to an buffer and trying to display it but a blank screen is getting dispalyed .May i know how can i do this.
THANKS in Advance Desika
//INCLUDES
// System includes #include <badesca.h> #include <e32std.h> #include <eikenv.h> #include <eikappui.h> #include <eikapp.h>
CGetIMEI::~CGetIMEI() { Cancel(); // Cancel any request, if outstanding // Delete instance variables if any iTimeWaster.Close(); if ( iTelephony ) { delete iTelephony; } }
void CGetIMEI::StartL() { Cancel(); // Cancel any request, just to be sure iState = EGetPhoneInfo; CTelephony::TPhoneIdV1Pckg phoneIdPckg( iPhoneId ); iTelephony->GetPhoneId(iStatus, phoneIdPckg); SetActive(); // Tell scheduler a request is active iActiveSchedulerWait.Start(); }
//#include <plpvariant.h> //Link against: plpvariant.lib GetIMEI() { TPlpVariantMachineId iImeiNo; // this should b you class data member #if __WINS__ //the number shown in case of emulator _LIT(KWinsImeiNo,"356658000505151"); TBuf<15> winsImeiNo(KWinsImeiNo); iImeiNo.Append(winsImeiNo); #else PlpVariant::GetMachineIdL(iImeiNo); #endif }
Forum posts: 62
this link will be helpful for you
http://www.newlc.com/Retrieving-the-device-IMEI-code.html
regards
Badshah
Forum posts: 34
CTelephony::GetPhoneId(TRequestStatus &aReqStatus, TDes8 &aId) const;
Interesting that getting imei in Symbian9 require the CAPABILITY ReadDeviceData.
Forum posts: 151
this link will be helpful for you
http://www.newlc.com/Retrieving-the-device-IMEI-code.html
regards
Badshah
Hi,
this method don't is good for my cellular.
I have a nokia 6681 series 60.
thanks
Silvia
Forum posts: 43
here is the a way to get IMEI in Symbian 9
//INCLUDES
// System includes
#include <badesca.h>
#include <e32std.h>
#include <eikenv.h>
#include <eikappui.h>
#include <eikapp.h>
//User includes
#include "getimei.h"
CGetIMEI* CGetIMEI::NewL(/*TDes& aIMEI*/)
{
CGetIMEI* self = new (ELeave) CGetIMEI(/*aIMEI*/);
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
CGetIMEI::CGetIMEI() : CActive(EPriorityHigh) // HIGH priority
{
/*,iIMEI(aIMEI)*/
iIMEI.Zero();
iState = EStart;
iTimeWaster.CreateLocal();
}
void CGetIMEI::ConstructL()
{
iTelephony = CTelephony::NewL();
CActiveScheduler::Add(this); // Add to scheduler
}
CGetIMEI::~CGetIMEI()
{
Cancel(); // Cancel any request, if outstanding
// Delete instance variables if any
iTimeWaster.Close();
if ( iTelephony )
{
delete iTelephony;
}
}
void CGetIMEI::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
}
void CGetIMEI::StartL()
{
Cancel(); // Cancel any request, just to be sure
iState = EGetPhoneInfo;
CTelephony::TPhoneIdV1Pckg phoneIdPckg( iPhoneId );
iTelephony->GetPhoneId(iStatus, phoneIdPckg);
SetActive(); // Tell scheduler a request is active
iActiveSchedulerWait.Start();
}
void CGetIMEI::RunL()
{
iState = EDone;
if ( iActiveSchedulerWait.IsStarted() )
{
iActiveSchedulerWait.AsyncStop();
if(iStatus == KErrNone)
{
iIMEI.Append(iPhoneId.iSerialNumber);
// iAppUi->iIMEI.Append(iPhoneId.iSerialNumber);
}
}
}
const TPtrC CGetIMEI::GetIMEI()
{
StartL();
TPtrC ptr(iIMEI.Ptr());
return ptr;
}
Forum posts: 8
in the following code const TPtrC CGetIMEI::GetIMEI() method returns an pointer sohow can i display the IMEI on my phone,can anyone suggests iam appending IMEI to an buffer and trying to display it but a blank screen is getting dispalyed .May i know how can i do this.
THANKS in Advance
Desika
//INCLUDES
// System includes
#include <badesca.h>
#include <e32std.h>
#include <eikenv.h>
#include <eikappui.h>
#include <eikapp.h>
//User includes
#include "getimei.h"
CGetIMEI* CGetIMEI::NewL(/*TDes& aIMEI*/)
{
CGetIMEI* self = new (ELeave) CGetIMEI(/*aIMEI*/);
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
CGetIMEI::CGetIMEI() : CActive(EPriorityHigh) // HIGH priority
{
/*,iIMEI(aIMEI)*/
iIMEI.Zero();
iState = EStart;
iTimeWaster.CreateLocal();
}
void CGetIMEI::ConstructL()
{
iTelephony = CTelephony::NewL();
CActiveScheduler::Add(this); // Add to scheduler
}
CGetIMEI::~CGetIMEI()
{
Cancel(); // Cancel any request, if outstanding
// Delete instance variables if any
iTimeWaster.Close();
if ( iTelephony )
{
delete iTelephony;
}
}
void CGetIMEI::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
}
void CGetIMEI::StartL()
{
Cancel(); // Cancel any request, just to be sure
iState = EGetPhoneInfo;
CTelephony::TPhoneIdV1Pckg phoneIdPckg( iPhoneId );
iTelephony->GetPhoneId(iStatus, phoneIdPckg);
SetActive(); // Tell scheduler a request is active
iActiveSchedulerWait.Start();
}
void CGetIMEI::RunL()
{
iState = EDone;
if ( iActiveSchedulerWait.IsStarted() )
{
iActiveSchedulerWait.AsyncStop();
if(iStatus == KErrNone)
{
iIMEI.Append(iPhoneId.iSerialNumber);
// iAppUi->iIMEI.Append(iPhoneId.iSerialNumber);
}
}
}
const TPtrC CGetIMEI::GetIMEI()
{
StartL();
TPtrC ptr(iIMEI.Ptr());
return ptr;
}
Forum posts: 14
Following code will help you.
GetIMEI()
{
TPlpVariantMachineId iImeiNo; // this should b you class data member
#if __WINS__
//the number shown in case of emulator
_LIT(KWinsImeiNo,"356658000505151");
TBuf<15> winsImeiNo(KWinsImeiNo);
iImeiNo.Append(winsImeiNo);
#else
PlpVariant::GetMachineIdL(iImeiNo);
#endif
}
http://discussion.forum.nokia.com/forum/showthread.php?t=68715
Regards,
PankajNeve
Regards,
Pankaj.
The best place to find the helping hand is at the end of your arm!!!
Forum posts: 18
Following code will help you.
{
#ifndef __WINS__
RTelServer* ts=new RTelServer;
ts->Connect();
RTelServer::TPhoneInfo pi;
ts->GetPhoneInfo(0,pi);
RBasicGsmPhone* ph=new RBasicGsmPhone;
ph->Open(*ts,pi.iName);
ph->Initialise();
RBasicGsmPhone::TId id;
ph->GetGsmPhoneId(id);
aImei=id.iSerialNumber;
delete ph;
ts->Close();
delete ts;
#else
aImei=_L("1234567890ABCDEF");
#endif
}
Forum posts: 2
Following code will help you.
 Â
{
#ifndef __WINS__
RTelServer* ts=new RTelServer;
ts->Connect();
RTelServer::TPhoneInfo pi;
ts->GetPhoneInfo(0,pi);
RBasicGsmPhone* ph=new RBasicGsmPhone;
ph->Open(*ts,pi.iName);
ph->Initialise();
RBasicGsmPhone::TId id;
ph->GetGsmPhoneId(id);
aImei=id.iSerialNumber;
delete ph;
ts->Close();
delete ts;
#else
aImei=_L("1234567890ABCDEF");
#endif
}
Thank you. Will try it!!
Rgds
- just me!!
______________________________________________
Rock While You Can