This page was last modified 15:25, 7 December 2007.
How to check if the phone is in offline mode
From Forum Nokia Wiki
There's a CenRep key KCoreAppUIsNetworkConnectionAllowed that can be used for detecting off-line mode.
#include <CoreApplicationUIsSDKCRKeys.h>
To ask one time:
TInt aOfflineModeOff(0); // Connecting and initialization: CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs); // Check offline mode on or not. if (repository->Get(KCoreAppUIsNetworkConnectionAllowed, aOfflineModeOff) == KErrNone) { // Do something based on the aOfflineModeOff value } delete repository; You might want to order notifications about the changes: iRepository = CRepository::NewL(KCRUidCoreApplicationUIs); iCenRepNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository, CCenRepNotifyHandler::EIntKey, KCoreAppUIsNetworkConnectionAllowed); iCenRepNotifyHandler->StartListeningL(); void CThisClass::HandleNotifyInt( TUint32 aId, TInt aNewValue ) { if (aId == KCoreAppUIsNetworkConnectionAllowed) { // Do something based on the aNewValue } } // Remeber to delete created objects in the destructor
S60 3rd, FP1
Another way to query the profile is to use the Profiles Engine Wrapper API:
#include <proengfactory.h>
#include <mproengengine.h>
MProEngEngine* engine = ProEngFactory::NewEngineLC();
TInt profileId = engine->ActiveProfileId();
if (profileId == 5) //offline
{
//…
}
CleanupStack::PopAndDestroy(); //engine
Internal Links
How to Detect Offline Mode in 3rd Edition
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Amora: PyS60 app to control Linux | savago | Python | 7 | 2007-09-29 16:20 |
| Offline content protection | kcome | Web Technologies and Multimedia Content- Web 技术和多媒体内容 | 0 | 2003-11-27 05:21 |
| Saving images to the phone | marc_otto | General Browsing | 2 | 2005-07-28 21:32 |
| Nokia 3650 startup issue - memory full | samkha | General Discussion | 3 | 2006-07-24 08:49 |
| how to put form in edit mode | rahulchavan_2000 | General Symbian C++ | 1 | 2005-03-05 06:53 |
