Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

How to detect if a Symbian device is in offline mode

From 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.
50 page views in the last 30 days.