You Are Here:

Community: Wiki

This page was last modified on 13 September 2009, at 12:15.

How to discover all installed applications

From Forum Nokia Wiki

Reviewer Approved   

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:

Headers:

#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);
CleanupStack::PushL(MyArray);
 
RApaLsSession ls;
User::LeaveIfError(ls.Connect());
CleanupClosePushL(ls);
 
User::LeaveIfError(ls.GetAllApps());
 
TInt ErrnoNo(KErrNone);
TApaAppInfo AppInfo;
 
do
{
ErrnoNo = ls.GetNextApp(AppInfo);
if(ErrnoNo == KErrNone && AppInfo.iCaption.Length())
MyArray->AppendL(AppInfo.iCaption);
} while(ErrnoNo == KErrNone);
 
CleanupStack::PopAndDestroy(); // ls
return MyArray;
}

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.

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia