×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    124

    How do I trigger java class from Connectivity SDK

    I am having problems giving appropriate arguments to pjava.exe. Method StartProgram in IECengineS allows triggering .exe files ... (Connectivity SDK side)

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    194

    RE: How do I trigger java class from Connectivity SDK

    Unfortunately Forum Nokia does not support Connectivity SDK. It is supported in Symbian Developer Network. Please, visit www.symbian.com/developer.

    <a href="https://www.symbian.com/developer">https://www.symbian.com/developer</a>


    However, one solution to this problem in the device end might be to write a simple exe application which in turn launches the pjava.exe with the correct command line arguments. This way the StartProgram method could be used without the need for commandline, as it is hardcoded in launched exe. Below is the source code and .mmp file for such an exe - modify the KLaunchAppCmdLine to match the launched java app's command line. Note that the classpath (-cp) argument must also be included to define the full path of application.

    It must be reminded that this is a workaround solution in the device end and not a very elegant one (to use an .exe to launch another .exe), and the launched java app does not appear in the task list (Normally java applications are launched via accompanying .app file). But it's tested to work and the generated .exe file size is small (< 1 KB). The connectivity SDK itself might provide better way to do this, but as previously stated there is no support for it by Forum Nokia.



    // applaunch.cpp

    #include <e32std.h>
    #include <e32base.h>

    // Literals

    _LIT(KPJavaExeFileName, "D:\\System\\Programs\\pjava.exe");
    _LIT(KLaunchAppCmdLine, "-cp \"D:\\System\\Apps\\Helloworld\" -Dcom.symbian.appName=\"Hello World\" Helloworld");

    LOCAL_C void DoStartExe();

    GLDEF_C TInt E32Main() // main function called by E32
    {
    _LIT(KE32Main, "E32Main");
    CTrapCleanup* cleanup=CTrapCleanup::New(); // get clean-up stack

    TRAPD(error, DoStartExe());
    __ASSERT_ALWAYS(!error,User::Panic(KE32Main,error));

    delete cleanup; // destroy the clean-up stack
    return(KErrNone);
    }


    LOCAL_C void DoStartExe()
    {
    RProcess launchProcess;
    if (launchProcess.Create(KPJavaExeFileName, KLaunchAppCmdLine) == KErrNone)
    {
    launchProcess.Resume();
    }
    }

    //-----------------------------------------------------------------

    // applaunch.mmp

    TARGET applaunch.exe
    TARGETTYPE exe
    UID 0
    SOURCEPATH .
    SOURCE applaunch.cpp
    SYSTEMINCLUDE \epoc32\include \epoc32\include\libc
    LIBRARY euser.lib
    STATICLIBRARY ecrt0.lib

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×