Device creators can use the APIs provided by APPARC to enumerate a list of applications on a device.
RApaLsSession apaLsSession; // Connect to the APPARC server User::LeaveIfError(apaLsSession.Connect());
// Get the list of all the applications on the device TInt ret = apaLsSession.GetAllApps(); if(ret==KErrNone) { TApaAppInfo appInfo; // Retrieve the next application in the list. // appInfo contains the application information while((ret= apaLsSession.GetNextApp(appInfo)) == KErrNone); // Make sure ENoMoreAppsInList is returned at the end of list. if(ret==RApaLsSession::ENoMoreAppsInList) { // No more applications in the list } }The following code snippet shows how to get a list of all the server applications on the device:
// Get the list of all the server applications on the device TInt ret = apaLsSession.GetServerApps(); if(ret==KErrNone) { TApaAppInfo appInfo; // Retrieve the next application in the list which provides a service. while((ret= apaLsSession.GetNextApp(appInfo)) == KErrNone); // Make sure ENoMoreAppsInList is returned at the end of list. if(ret==RApaLsSession::ENoMoreAppsInList) { // No more server applications in the list } }The following code snippet shows how to get a list of all the embedded applications on the device:
// Get the list of all the embedded applications on the device TInt ret = apaLsSession.GetEmbeddedableApps(); if(ret==KErrNone) { TApaAppInfo appInfo; // Retrieve the next embedded application in the application list while((ret= apaLsSession.GetNextApp(appInfo)) == KErrNone); // Make sure ENoMoreAppsInList is returned at the end of list. if(ret==RApaLsSession::ENoMoreAppsInList) { // No more embedded applications in the list } }The following code snippet shows how to get a list of all the filtered applications on the device:
// Get the list of all the application based on the filter defined in the parameter passed to it. TApaEmbeddabilityFilter &filter = TApaEmbeddabilityFilter(); filter.AddEmbeddability(TApaAppCapability::EEmbeddableUiOrStandAlone); TInt ret = apaLsSession.GetFilteredApps(filter); if(ret==KErrNone) { TApaAppInfo appInfo; // Retrieve the next application in the application list that matches the specified filter. while((ret= apaLsSession.GetNextApp(appInfo)) == KErrNone); // Make sure ENoMoreAppsInList is returned at the end of list. if(ret==RApaLsSession::ENoMoreAppsInList) { // No more filtered applications in the list } }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.