Archived:Get Manufacturer and Model number of the device using CTelephony
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
Article Metadata
Code Example
Source file: Media:MyTelephonyPhoneId.zip
Tested with
Devices(s): E61i
Compatibility
Platform(s): S60 3rd Edition
Article
Keywords: CTelephony::GetPhoneId()
Created: savaj
(08 May 2009)
Last edited: hamishwillee
(29 Jun 2012)
Contents |
Overview
CTelephonyReader implementation illustrates how to get Manufacturer and Model number of the device in S60 3rd Edition with CTelephony API.
The implementation is pretty simple, and when using this one only thing to do in calling class is to implement the callback interface and then to construct an instance of the CTelephonyReader.
Headers Required
#include <Etel3rdParty.h>Library Needed
LIBRARY etel3rdparty.libCapability Required
Capability None
TelephonyReader.h
#ifndef __TELEPHONYREADER_h__
#define __TELEPHONYREADER_h__
#include <Etel3rdParty.h>
class MTelephonyObserver
{
public:
virtual void GetPhoneId(const TDesC& aManufacturer,const TDesC& aModel) = 0;
};
class CTelephonyReader : public CActive
{
public:
static CTelephonyReader* NewL(MTelephonyObserver* aObserver);
static CTelephonyReader* NewLC(MTelephonyObserver* aObserver);
void ConstructL(void);
~CTelephonyReader();
protected:
void DoCancel();
void RunL();
private:
CTelephonyReader(MTelephonyObserver* aObserver);
private:
MTelephonyObserver* iObserver;
CTelephony* iTelephony;
CTelephony::TPhoneIdV1 iPhoneIdV1;
CTelephony::TPhoneIdV1Pckg iPhoneIdV1Pckg;
};
#endif //__TELEPHONYREADER_h__
TelephonyReader.cpp
#include "TelephonyReader.h"
CTelephonyReader* CTelephonyReader::NewL(MTelephonyObserver* aObserver)
{
CTelephonyReader* self = NewLC(aObserver);
CleanupStack::Pop(self);
return self;
}
CTelephonyReader* CTelephonyReader::NewLC(MTelephonyObserver* aObserver)
{
CTelephonyReader* self = new (ELeave) CTelephonyReader(aObserver);
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
CTelephonyReader::CTelephonyReader(MTelephonyObserver* aObserver)
:CActive(0),iObserver(aObserver),iPhoneIdV1Pckg(iPhoneIdV1)
{
}
CTelephonyReader::~CTelephonyReader()
{
Cancel();
delete iTelephony;
}
void CTelephonyReader::ConstructL(void)
{
CActiveScheduler::Add(this);
iTelephony = CTelephony::NewL();
iTelephony->GetPhoneId(iStatus,iPhoneIdV1Pckg);
SetActive();
}
void CTelephonyReader::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
}
void CTelephonyReader::RunL()
{
if(iStatus == KErrNone)
{
iObserver->GetPhoneId(iPhoneIdV1.iManufacturer,iPhoneIdV1.iModel);
}
}


Why did you create a new article when there already exist such an article?
Please reply as soon as possible otherwise I will delete this article.
Thanks, --kiran10182 21:44, 8 May 2009 (EEST)
Certainly none of these article show how to get model number and Manufacturer. Also missing working code example.
Then certainly you need to update those existing articles to contain such features rather than creating a similar redundant articles. Please do so to avoid multiple entries of the same article on Wiki and to prove what Wiki means to be.
Thanks, --kiran10182 09:29, 9 May 2009 (EEST)
Ok. This article contains much more information than just IMEI so let this be here. Let me remove IMEI stuff from this article and move it to something more appropriate title which will exclude IMEI part. So that people will find it more easy in searching.
Thanks, --kiran10182 09:50, 9 May 2009 (EEST)