How to read imei?

Login to reply to this topic.
Tue, 2006-08-08 13:38
Joined: 2006-07-21
Forum posts: 151
Hi,
I need to read imei of telephon series60.
What is the code for this operation?
thanks
Silvia

Wed, 2006-08-09 06:14
Joined: 2005-11-16
Forum posts: 62
Re: How to read imei?
Hi,
    this link will be helpful for you

http://www.newlc.com/Retrieving-the-device-IMEI-code.html

regards
Badshah
Wed, 2006-08-09 21:18
Joined: 2006-06-27
Forum posts: 34
Re: How to read imei?
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.
Fri, 2006-08-11 15:50
Joined: 2006-07-21
Forum posts: 151
Re: How to read imei?
Quote from: Badshah
Hi,
    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
Mon, 2006-11-13 13:16
Joined: 2005-09-22
Forum posts: 43
Re: How to read imei?

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;
   }
Wed, 2007-02-21 06:05
Joined: 2006-09-27
Forum posts: 8
Re: How to read imei?
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>

//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;
   }
Wed, 2007-02-21 13:52
Joined: 2007-02-12
Forum posts: 14
Re: How to read imei?
Hi guys,

Following code will help you.

Code:
//#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
}
or you will find the answer to your questiona at following link
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!!!

Thu, 2007-02-22 11:51
Joined: 2007-01-01
Forum posts: 18
Re: How to read imei?
hi ,
Following code will help you.


   
Code:
void CGetIMEIContainer::GetImei(TDes &aImei)
{
#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

}
Fri, 2007-02-23 12:46
Joined: 2007-02-23
Forum posts: 2
Re: How to read imei?
Quote from: ankushbabrekar
hi ,
Following code will help you.


   
Code:
void CGetIMEIContainer::GetImei(TDes &aImei)
{
#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

  • Login to reply to this topic.