A native application can launch a MIDlet with the javalauncher.exe
executable. The MIDlet to be launched is identified in a similar
manner as when using javaapp:
.
The following example code shows how to launch a MIDlet from a native Symbian application.
RProcess rProcess; TInt err = rProcess.Create(_L("javalauncher.exe"), _L("midlet-uid=0x10137c4d;startMode=startFromCmdLine;sound=ON;landscapeMode=true;")); if (KErrNone == err) { TRequestStatus status; rProcess.Logon(status); rProcess.Resume(); // now wait until javalauncher exits User::WaitForRequest(status); if (status.Int() != KErrNone) { // Launching midlet failed err = status.Int(); } } else { // Cannot start javalauncher } rProcess.Close();
The following example code shows how to launch the same MIDlet from a Symbian application using Open C APIs.
include <glib.h> gint exitStatus = 0; // Start javalauncher and wait until it starts midlet gboolean startOK = g_spawn_command_line_sync( "javalauncher midlet-uid=0x10137c4d;startMode=startFromCmdLine;sound=ON;landscapeMode=true;", NULL, NULL, &exitStatus, NULL); if (startOK) { if (exitStatus != 0) { // launching midlet failed, (Symbian) error code in exitStatus } } else { // Cannot start javalauncher }