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 discover all installed applications

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia 5800
Created: symbianyucca (20 Mar 2007)
Last edited: hamishwillee (21 May 2013)

RApaLsSession can be used to get all currently installed applications from the device. The following code sample shows how to get an array containing names of the installed applications:


#include <APGCLI.H>
#include <BADESCA.H>

Link against:

LIBRARY apgrfx.lib
LIBRARY bafl.lib
CDesCArray* CMyClass::GetApplicationsLC()
const TInt KArrGranularity = 10;
CDesCArrayFlat* MyArray = new(ELeave) CDesCArrayFlat(KArrGranularity);
RApaLsSession ls;
TInt ErrnoNo(KErrNone);
TApaAppInfo AppInfo;
ErrnoNo = ls.GetNextApp(AppInfo);
if(ErrnoNo == KErrNone && AppInfo.iCaption.Length())
} while(ErrnoNo == KErrNone);
CleanupStack::PopAndDestroy(); // ls
return MyArray;

If you are interrested only in not hidden applications you may want to add some code like:

        //Get app capabilities
TApaAppCapabilityBuf capability;
User::LeaveIfError(ls.GetAppCapability(capability, AppInfo.iUid));
if (capability().iAppIsHidden)
//Don't show hidden apps

To get application list change notifications take a look at CApaAppListNotifier from apgnotif.h.

TApaAppInfo also has many other information items of the application that can be utilized when airing application information, for example Get application icon shows how to get the application icon using the application UID that van be retrieved using the code sample shown above.

This page was last modified on 21 May 2013, at 00:48.
33 page views in the last 30 days.