This page was last modified 00:33, 11 April 2008.
How to launch an application with its UID
From Forum Nokia Wiki
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 Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem launching RealOne from another application | rem.collier@ucd.ie | Symbian Tools & SDKs | 0 | 2004-07-07 22:31 |
| Auto Startup Application Signing! | amerzannouneh | Symbian Signing, Certification and Security | 43 | 2008-07-09 17:35 |
| uid | minimaniac | General Symbian C++ | 2 | 2003-05-26 09:33 |
| Hooklogger usage problem | vinayakak | Symbian Tools & SDKs | 15 | 2007-03-23 16:40 |
| Application embedding in 3rd edition | symbianyucca | General Symbian C++ | 13 | 2007-04-27 04:55 |
