×
Namespaces

Variants
Actions

Archived:Get SIM status in S60 2nd Edition

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: 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
CompatibilityArticle
Created: savaj (01 May 2009)
Last edited: hamishwillee (19 Jun 2012)

How to get SIM status in S60 2nd Edition

Following example illustrate how to get SIM status in S60 2nd Edition devices.

SIM status information: Indicates current status of SIM card.

Case1: Say SIM card is present in phone and is ok.

Case2: Say SIM card is not present in phone.

Case3: Say SIM card is present in phone but rejected by operator.

Headers required:

#include <saclient.h>
#include <sacls.h>

Library required:

LIBRARY sysagt.lib

Source code:

void CSimStatusAppUi::SimStatus()
{
RSystemAgent sysAgent;
sysAgent.Connect();
TInt status = sysAgent.GetState(KUidSIMStatus);
 
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
switch(status)
{
case ESASimOk:
{
informationNote->ExecuteLD(_L("Sim present in phone and it is ok"));
break;
}
case ESASimNotPresent:
{
informationNote->ExecuteLD(_L("Sim not present in phone"));
break;
}
case ESASimRejected:
{
informationNote->ExecuteLD(_L("Sim present in phone but rejected by operator"));
break;
}
default:
{
informationNote->ExecuteLD(_L("Info not available"));
}
break;
}
 
}


Related link:

This page was last modified on 19 June 2012, at 04:02.
45 page views in the last 30 days.