You Are Here:

Community: Wiki

This page was last modified on 3 September 2009, at 18:24.

How to launch an application with its UID

From Forum Nokia Wiki

Reviewer Approved   

We can launch any application installed on a device with it's UID rather using the name of the application .

  • By this way we can prevent the name clashes.
  • No need for searching for the full path of the application.


In mmp file:

LIBRARY        apgrfx.lib // for RApaLsSession
LIBRARY apparc.lib // for CApaCommandLine, TApaAppInfo


Source code

// System Includes
#include <apgcli.h> // for RApaLsSession
#include <apacmdln.h> // for CApaCommandLine
 
// ...
 
// ----------------------------------------------------------------------------
// CMyUtility::LaunchAppL(const TUid aAppUid)
// Find the application with it's UID and if exists then launch the
// application to the foreground.
// ----------------------------------------------------------------------------
//
void CMyUtility::LaunchAppL(const TUid aAppUid) const
{
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
 
TApaAppInfo appInfo;
TInt retVal = apaLsSession.GetAppInfo(appInfo, aAppUid);
 
if(retVal == KErrNone)
{
CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
cmdLine->SetExecutableNameL(appInfo.iFullName);
cmdLine->SetCommandL(EApaCommandRun);
User::LeaveIfError( apaLsSession.StartApp(*cmdLine) );
 
CleanupStack::PopAndDestroy(cmdLine);
}
else
{
// The application not found!
}
 
CleanupStack::PopAndDestroy(&apaLsSession);
}


Related Links:

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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fFileE3aMicrokernelE5fArchitectureE2eGIFX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx5E2E0000X