Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Launching system applications from PersonalJava on a P800

4 replies · 3,915 views · Started 09 April 2003

Hi,

I'm using PersonalJava on a P800, and I have some questions on launching system applications from a class:

1) I want to launch the Viewer application, and I'm using the following code to launch it:

Runtime.getRuntime().exec("Z:\\System\\Programs\\AppRun.exe Z:\\System\\Apps\\Viewer\\Viewer.app"😉;

which launches the Viewer, but it displays the following error message:

Error
View window could not open the file - check path and read permissions

Do I have to specify a file here? If so, what arguments do I need to specify in the command to launch the Viewer?

2) I also tried launching the Internet browser from java, with the following code:

Runtime.getRuntime().exec("Z:\\System\\Programs\\AppRun.exe Z:\\System\\Apps\\Internet\\Internet.app"😉;

However, when I run this code, it doesn't launch the browser, but displays a "Not found" dialog. I'm assuming that the app name I'm using, 'Internet', is incorrect here, any ideas how to do this?

3) Is there a document available that specifies all of the arguments supported by all of the system UIQ applications? eg the Internet browser, Video player etc.

thanks,
Derek

Hello you could try for example these exec statements :

Z:\System\Programs\AppRun.exe Z:\System\Apps\Audio\Audio.app "C:\documents\Media files\audio\unfiled\Disco.mid"
(or any other audio file).

You need to figure out the escape chars needed to accomplish the above result in a Java text string. The " chars dhown above is needed to enclose that space character in 'Media files'.

This launches the Audio player towards an audio file. The user needs to press Play on the native UI to play. Due to a random fortunate circumstance there is a back button in that naive UI that will (almost always) take you back to your Java app..

Z:\System\Programs\AppRun.exe Z:\System\Apps\browserviewer\browserviewer.app http://yoursite.com

Should launch the browser towards an URL, you then cannot return to the PJava app other than by selecting it from the app launcher.

None of the above is any endorsed or supported ways of launching native apps from PJava but for fun you could try it.

Thanks for that, adding " (escaped by \) around the filenames works. On a side note, I found out that it's also possible in C++ using the following function:

QikFileUtils::StartAppL(fileName);

It launches the appropriate viewer depending on the type of 'fileName'.

Derek

Hi,

Following on from this, do you know if its possibly to use AppRun.exe to launch the MMS application on the P800 and pass it content such as an Audio file or image.

(the idea being the user could then easily pass the content onto someone using MMS).

Thanks,

Peter

derek_ocallaghan wrote:Hi,

2) I also tried launching the Internet browser from java, with the following code:

Runtime.getRuntime().exec("Z:\\System\\Programs\\AppRun.exe Z:\\System\\Apps\\Internet\\Internet.app"😉;

However, when I run this code, it doesn't launch the browser, but displays a "Not found" dialog. I'm assuming that the app name I'm using, 'Internet', is incorrect here, any ideas how to do this?

thanks,
Derek

Try replacing "Internet" with "Browser".

Best regards,
Malcolm
www.freepoc.org