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.

Profiles Engine API

From 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}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Code ExampleCompatibility
Created: ltomuta (17 Jun 2007)
Last edited: lpvalente (12 Jul 2014)

Note.pngNote: :This API is not part of the public SDK. It can be found in the SDK API Plug-in.

ProfileEngine API's are mainly used to get the list of available profiles on the mobile, get the information about the active profile, to get information of the profile change, set a profile and related information about it.

Header files

#include <mprofileengine.h>
#include <mprofilesnamesarray.h>
#include <mprofile.h>
#include <mprofilename.h>
#include <mprofiletones.h>

Link against


Capabilities required for activating new profile: WriteDeviceData

Use cases

These API's are used to show the Profiles. Also used to retrieve information of the currently Active Profile,its Id, Ringtone, MessageAlertTone. They can also be used to set a particular Profile active.

Example code

Before using the API's first we create an instance of MProfileEngine using "CreateProfileEngineL()" API

MProfileEngine* lProfileEngine = CreateProfileEngineL();

Free the resources using "Release()" API


or alternatively first Push it onto CleanupStack and then PopAndDestroy()

CleanupReleasePushL( *lProfileEngine );

The following code snippet is used to get the available profiles on the phone.

MProfilesNamesArray* profilesNamesArray = 
TInt lCount = profilesNamesArray->MdcaCount();
for(TInt i=0;i<lCount;i++)
TBuf<20> lName;
lName= profilesNamesArray->ProfileName(i)->Name();
CEikonEnv::Static()->AlertWin(_L("Available Profiles:"),lName);

The following code snippet is used to list the details of the Active profile and its properties like Profile Name, Id, etc.,

MProfile* lProfile =  lProfileEngine->ActiveProfileL();
CleanupReleasePushL( *lProfile );
const MProfileName& lMProfileName = lProfile->ProfileName();
TBuf<10> lProfileName = lMProfileName.Name();
CEikonEnv::Static()->AlertWin(_L("Profile Name:"),lProfileName);
TInt lId = lMProfileName.Id();
TBuf<10> lProfileId;
CEikonEnv::Static()->AlertWin(_L("its Profile Id:"),lProfileId);
const MProfileTones& lMProfileTones = lProfile->ProfileTones();
TBuf<255> lProfileTone1 = lMProfileTones.RingingTone1();
CEikonEnv::Static()->AlertWin(_L("Profile Ringtone1:"), lProfileTone1);
TBuf<255> lProfileMsgalrt = lMProfileTones.MessageAlertTone();

The following code snippet is used to set the Profile:

We pass the Id of the Profile Name to set the Profile active.


The following link is useful in getting notifications of profile change:Profile Change

Example project