How to detect if a Symbian device is in offline mode

From Nokia Developer Wiki
Jump to: navigation, search

This article shows how to detect whether a Symbian device is in "offline" mode by querying the device profile.

Article Metadata
Created: vasant21 (04 May 2007)
Last edited: hamishwillee (30 May 2013)

Headers Required:

#include <centralrepository.h>
#include <ProfileEngineSDKCRKeys.h>

Library needed:

LIBRARY  centralrepository.lib

We need to Query Central Repository.

CRepository* cRepository = CRepository::NewLC( KCRUidProfileEngine );

CurrentProfileId will be used to hold the current active profile id.

TInt CurrentProfileId;

Get current profile Id.

//KProEngActiveProfile is the id of the currently active profile.
User::LeaveIfError( cRepository->Get( KProEngActiveProfile, CurrentProfileId ) );

Check CurrentProfileId to determine the active profile.

Possible values of CurrentProfileId can be one of the following:
  • 0 = General profile (default value)
  • 1 = Silent profile
  • 2 = Meeting profile
  • 3 = Outdoor profile
  • 4 = Pager profile
  • 5 = Off-line profile
  • 6 = Drive profile
  • 30-49 = User-created profiles
if ( CurrentProfileId == 5 )
// It means that the current profile is in the offline mode.
// Similarly you can check for any active profile by comparing the
// CurrentProfileId.

Internal Links:

This page was last modified on 30 May 2013, at 02:57.
42 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.