There is two kind of native applications in a Symbian system:
APP are the applications that have a GUI and therefore are visible from the end-user
EXE are generally server or command-line application that generally run hidden since they have no GUI and cannot be directly launched from the main menu.
Manual Launch
If you are a end-user and want to start an APP : it will be listed in the menu of your phone if it is properly installed [1]
Launching an EXE cannot be done directly since an EXE application will not be visible from the main menu and trying to launch if from the Inbox (where it may be stored if you download it over IrDA or Bluetooth) will cause a security error. First you will need to install a File Explorer like application (like FileMan or FExplorer), browse to the location where it is saved (the inbox directory is C:\system\Mail\xxx on my 3650), and then run it.
Program launch
Starting programmatically an APP or EXE file is very simple once you know which API to use.
To start an EXE application:
#include <EikDll.h>
...
_LIT(KMyAppName, "c:\\system\\Apps\\MyApp\\MyApp.exe");
EikDll::StartExeL(KMyAppName);
The code to start an APP is slightly more complex but allow to specify a document name:
#include <EikDll.h>
#include <apacmdln.h>
...
_LIT(KMyAppName, "c:\\system\\Apps\\MyApp\\MyApp.app");
_LIT(KMyDocName, "c:\\Documents\\MyApp.dat");
CApaCommandLine * cmd=CApaCommandLine::NewL();
cmd->SetLibraryNameL(KMyAppName);
cmd->SetDocumentNameL(KMyDocName);
cmd->SetCommandL(EApaCommandRun);
EikDll::StartAppL(*cmd);
Launching Browser or other Nokia applications
If you intend to start ROM based Series 60 application, it may be worth to take a look at the Utilizing External Application Views document on Forum Nokia.
The following code (taken from the document above) will start the browser on a specified page:
#include <apgcli.h> // apgrfx.lib
void NNewLCUtils::StartBrowser(const TDesC& aUrl)
{
HBufC* param = HBufC::NewLC( 256 );
param->Des().Format( _L( "4 %S" ),&aUrl );
// Wap Browser's constants UId
const TInt KWmlBrowserUid = 0x10008D39;
TUid id( TUid::Uid( KWmlBrowserUid ) );
TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindApp( id );
if ( task.Exists() )
{
HBufC8* param8 = HBufC8::NewLC( param->Length() );
param8->Des().Append( *param );
task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used
CleanupStack::PopAndDestroy(); // param8
}
else
{
RApaLsSession appArcSession;
User::LeaveIfError(appArcSession.Connect()); // connect to AppArc server
TThreadId id;
appArcSession.StartDocument( *param, TUid::Uid( KWmlBrowserUid ), id );
appArcSession.Close();
}
CleanupStack::PopAndDestroy(); // param
}
[1] The two main reason that can make your APP not visible are:
a bad UID : the UID you use for your application is already used by anothe one present on your phone. Check here if you want to learn more on about to solve this
a bad directory name: your application shall be stored in a directory that has the same name as you app file, ex: c:\system\apps\myApp\myApp.app
|