×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    13

    Question platformRequest "localapp://jam/launch" on S60 5th

    Hi Folks,

    I'm trying to start a MIDlet from another MIDlet as described here: http://library.forum.nokia.com/topic...AC6EDFA9A.html

    Lets say my MIDlet is called MyMIDlet:
    - MyMIDlet is installed an can be launched manually just fine
    - the MIDlet is signed, putting it in the trusted third party domain
    - the corresponsing JAR properties MIDlet-Name and MIDlet-Vandor are set correctly
    - I tried to add "midlet-n=1" to the launch URL with no effect

    Now on my N97 V21.2.045 when I call:

    Code:
    platformRequest("localapp://jam/launch?midlet-name=MyMIDlet;midlet-vendor=Me);
    - no exception is thrown, the URL is valid
    - the call returns false, the request was not postponed until the MIDlet exits
    - AND most importantly nothing happens?!

    When I call:

    Code:
    platformRequest("javaapp:midlet-name=MyMIDlet;midlet-vendor=Me);
    - a CNFE is thrown


    Any ideas on how to get it working? I'm trying to avoid using the PushRegistry because the use case happens entirely on the device with no other third party involved.

    I appreciate your help.

    Thank you and regards,
    Christian

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Now on my N97 V21.2.045 when I call:


    Code:
    platformRequest("localapp://jam/launch?midlet-name=MyMIDlet;midlet-vendor=Me);
    - no exception is thrown, the URL is valid
    - the call returns false, the request was not postponed until the MIDlet exits
    - AND most importantly nothing happens?!

    When I call:


    Code:
    platformRequest("javaapp:midlet-name=MyMIDlet;midlet-vendor=Me);
    - a CNFE is thrown
    Have to missed the Quotes at the end?

    It should be --> platformRequest("localapp://jam/launch?midlet-name=MyMIDlet;midlet-vendor=Me");

    and platformRequest("javaapp:midlet-name=MyMIDlet;midlet-vendor=Me");

    What's a CNFE ?

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: platformRequest "localapp://jam/launch" on S60 5th

    How are you sure that the URL you are trying to access is valid?

    platformRequest("localapp://jam/launch?midlet-name=MyMIDlet;midlet-vendor=Me);
    What about the red-bold char?
    According to me this should be "&"...
    Please check.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Nokia Developer Expert
    Join Date
    Jul 2004
    Posts
    15

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hi,

    > I'm trying to start a MIDlet from another MIDlet as described here:
    > ...
    > Now on my N97 V21.2.045 when I call:
    >
    >
    Code:
    platformRequest("localapp://jam/launch?midlet-name=MyMIDlet;midlet-vendor=Me);
    Do you have Java Runtime 2.1 in your device? This is a new feature in Java Runtime 2.1 available in Nokia Beta Labs. The release notes of Java Runtime 2.1 ( http://wiki.forum.nokia.com/index.ph..._Release_notes ) mention:

    List of new features:
    ...
    PlatformRequest extension that allows MIDlets to launch other MIDlets and native Symbian applications and pass arguments to them.
    ...

    The page you were referring didn't mention anything about S60 or Java Runtime version :-(.

    M

  5. #5
    Nokia Developer Expert
    Join Date
    Jul 2004
    Posts
    15

    Re: platformRequest "localapp://jam/launch" on S60 5th

    > Do you have Java Runtime 2.1 in your device?
    > This is a new feature in Java Runtime 2.1 available in Nokia Beta Labs.

    And link to the Java Runtime 2.1 beta is here:

    http://betalabs.nokia.com/apps/java-runtime-for-Symbian

    M

  6. #6
    Registered User
    Join Date
    Jul 2009
    Posts
    13

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hi im2amit,

    thanks for you reply.
    The missing quotes are just a typo in my post. It wouldn't really compile without them

    CNFE means ConnectionNotFoundException. The only Exception thrown by platformRequest().

    Cheers,
    Christian

  7. #7
    Registered User
    Join Date
    Jul 2009
    Posts
    13

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hi raj_J2ME,

    well according to the documentation I cited it has to be a semicolon instead of an ampersand. I tried an ampersand as delimiter before I started this thread, it's not working anyway.

    regards,
    Christian

  8. #8
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: platformRequest "localapp://jam/launch" on S60 5th

    quoting the library you pointed to (launching application with parameter):
    "The ability to launch MIDlets with command line arguments is supported from Java Runtime 2.1 onwards"

    And the documentation for the N97:
    "Java Runtime Java Runtime 1.4 for S60"

    I would say that this has no way to work.

  9. #9
    Registered User
    Join Date
    Jul 2009
    Posts
    13

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hi njzk2,

    thank you, I read the doc as well and it obviously leaves room for interpretation. I do not want to launch a MIDlet >with< parameters. I want to launch it >without< parameters.
    But probably you and mtm72c are right and it's only supported from 2.1 onwards. This document as well is then too vaguely >hinting< the functionality might only be supported form 2.1 onwards. But assuming that it actually states this very fact implies the protocols "http:", "file:", etc. are not supported in 1.4, which they are. You get my point?

    Is anyone else missing clear "@since" tags in the library?

    Anyway, thank's to all of you for the input! The 2.1 VM is clearly not an option for a production environment yet so I'm giving up on this.

    Have a good one,
    Christian

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: platformRequest "localapp://jam/launch" on S60 5th

    I'm trying to avoid using the PushRegistry because the use case happens entirely on the device with no other third party involved.
    No thirdparty is required for using PushRegistry to start another Midlet, you can use PushRegistry on Alarm to start another midlet from one in the same midlet suite.

    See this link: http://www.java-tips.org/java-me-tip...er-midlet.html

    thanks,
    ~Amitabh

  11. #11
    Registered User
    Join Date
    Jul 2009
    Posts
    13

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hey Amitabh,

    I know I can use registerAlarm and I already tried it. It's not working in my case due to a eSWT/LCDUI toolkit conflict (probably a bug). A little explanation.

    Preconditions:
    - You can not control the device's backlight from within an eSWT app using DeviceControl.setLights(). No other method is available, I had a conversation with Gorkem about this.
    - When I launch a helper MIDlet from my eSWT app from within the same suite using registerAlarm the setLights call works for a number of calls (you have to repeatedly call it to keep the light turned on) then after some calls it throws an OutOfMemoryError. I decompiled the code and found a switch statement in DeviceControlImpl.setLights(int,int). It receives an unknown retVal from the native _setLights call and then says "throw new OutOfMemoryError()". (In DeviceControlImpl retVal of native _setLights is switched, default case says "throw new OOME" so its not me clogging up the heap)
    - So I cannot start the helper from within the same suite. When I put the helper in a discrete suite and launch it manually it works though.

    Now:
    - I still need to somehow automatically launch the helper.
    - PushRegistry with dynamic registration would be fine but since I cannot register a socket or datagram listener with the AMS on something like "localhost" it leaves me no options. Registering e.g "datagram://:1234" makes the AMS listening on the carrier network interface only and I have no means of retrieving its address from the calling MIDlet while say WiFi is connected. So I can never send something to the open port. Add. if the phone profile is Offline it can inherently never work (I actually tried that in desperation).
    - If there is a way so send a SMS locally I could at least register a sms://: listener and send an "device internal" message. But after hours of searching it seems this can't be done. And it still would not work in offline mode.
    - Well localapp:/jam/launch was sort of my last hope.

    Thanks for you tips!

    Cheers,
    Christian

    OT: Gee, this platform is soo 2001! If only the Eclipse folks had specified MIDP, not these SUN whatevers. I know about the disabilities of those "highly resource constrained" devices. But those devices are 2003 at best. I have a "not so resource constrained" device here. Why does it have to feast on the poor mans sweets?

  12. #12
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hello cschlesinger,

    on JRT for Symbian improvements, you can submit them here: http://betalabs.nokia.com/apps/java-...ian/suggestion

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  13. #13
    Registered User
    Join Date
    May 2009
    Posts
    8

    Re: platformRequest "localapp://jam/launch" on S60 5th

    platformRequest "localapp://jam/launch" works on S40?

    I'm trying to call another java application from my s40 app... I don't know what I must to do anymore, I've trying differents ways, but nothing works.

  14. #14
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: platformRequest "localapp://jam/launch" on S60 5th

    Hello yhafc,

    and welcome to Forum Nokia Discussion Boards!

    EDIT:

    Unfortunately this URI scheme is freely available on Symbian platform only.

    For Series 40 platform, the following requirement applies:

    localapp:
    ..
    In Series 40, only allowed for manufacturer and operator MIDlets.
    More about in Forum Nokia Java Developer's Library:

    Java Developer's Library 3.5 > Developer's Guides > Invoking applications > Invoking applications in Java ME


    Regards,
    r2j7
    Last edited by r2j7; 2010-06-03 at 20:45.
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  15. #15
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: platformRequest "localapp://jam/launch" on S60 5th

    first thing to know is that s40 is a mono application system, which basically means that you can't have 2 applications running at the same time.
    the easiest way to have 2 applications communicating is via push registry :
    one application registers a port, the other launches a connection to it, it wakes up the first application.
    but since you cannot have 2 applications running at the same time, you have to open the connection, send your data, and close the application. The first application will wake up and receive the data. You can have a similar process to wake up the second application again.
    (i presume this is fully documented on the wiki)

Similar Threads

  1. Replies: 16
    Last Post: 2011-01-03, 10:54
  2. Any chance to profile MIDlet inside S60 5th emulator
    By cschlesinger in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-02-22, 10:56
  3. Replies: 1
    Last Post: 2010-01-11, 09:58
  4. S60 5th edition porting issue
    By raj_rr7 in forum Symbian
    Replies: 6
    Last Post: 2009-08-20, 10:45
  5. Python for S60 1.9.2 released
    By tvijayan in forum Symbian
    Replies: 26
    Last Post: 2009-03-11, 09:28

Posting Permissions

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