×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    28

    How can the WAP browser communicate to J2ME application?

    I'm developing a J2ME application, which should start from a WAP page. I mean, the user client opens the WAP browser, goes to the application specific wml page in the mobile, clicks in the link ýstart applicationý and then, the J2ME application starts. Is this possible?

    If it is impossible, I have though the following solution:
    The user client starts the J2ME application. The J2ME application does nothing excepting make an HTTP request to the WEB server where the wml pages are located. The WEB server doesnýt send the HTTP response still. Then, the user client opens the WAP browser, keeping the J2ME application in background listening to the HTTP response from the WEB server. The user client goes to the application specific wml page in the mobile, clicks in the link ýstart applicationý, which inform to the WEB server that the user client wants to start the application. Then, the WEB server sends back the previous HTTP response to the J2ME application, which goes to foreground when it receives the HTTP response. Can a J2ME application listen to an HTTP response in background and goes to foreground when it receives the HTTP response?

    In order to avoid the user client to start the application before opening the WAP browser, I have though in the following solution. Start the J2ME application when the mobile is switched on. The J2ME application will be in start-up programs of the mobile, like in Windows. Is this possible?

    Thanks in advance

    Hector

  2. #2
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    1. You can not launch a midlet from a wml page (but you can install).
    2. You can not launch a midlet automatically when the mobile is switched on.

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    7

    Re: How can the WAP browser communicate to J2ME application?

    Quote Originally Posted by kisember
    1. You can not launch a midlet from a wml page (but you can install).
    2. You can not launch a midlet automatically when the mobile is switched on.

    I want to ask the Question does anyone know how to developan application which runs in Background in J2Me and wakes up on specific events.

    Thanks in advance

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    7

    Re: How can the WAP browser communicate to J2ME application?

    Quote Originally Posted by kisember
    1. You can not launch a midlet from a wml page (but you can install).
    2. You can not launch a midlet automatically when the mobile is switched on.

    I want to ask the same Question does anyone know how to develop an application which runs in Background for J2Me and wakes up on specific events.

    Thanks in advance

  5. #5
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: How can the WAP browser communicate to J2ME application?

    as kisember pointed out, you cannot load a midlet on startup (on nokia , I think motorola you can, and RIM i know you can) unlesas you use a C++ daemon to launch the MIDlet

    But if the user launched it, then it can be set to the background, in which it would execute thread.sleep(5000) say to wake every 5 seconds, perform some task, then go back to background

    Nokia should implement the Midlet url schema, as sprint has, in which you can launch an installed midlet from a web page in browser, you can also pass the midlet parameters/data
    Jason Glass
    http://IChiBanComputers.Com

  6. #6
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: How can the WAP browser communicate to J2ME application?

    Hi hbfornies,

    Just as a supplement to kisember and Jason notes and tips. If you need activation, MIDP's 2.0 Push Registry seems to be a good choice for many use cases. Check the link below if you don't know what PR is.

    The MIDP 2.0 Push Registry
    http://developers.sun.com/techtopics...icles/pushreg/

    BR

  7. #7
    Registered User
    Join Date
    Mar 2006
    Posts
    21

    Re: How can the WAP browser communicate to J2ME application?

    Jason,

    You specifically mention Sprint as having the ability to launch a Java app from a URL. What about Nokia phones offered on Sprint, then?

    Also, someone else mentioned this possibility:
    One workaround I see is to put a link in your web page with something like "localhost:5234" and have the user click it. Your midlet would be registered with Push Registry at the very same location, and maybe it would be triggered by the browser trying to connect to a local socket.

    Does anyone agree this could tackle the issue?

    Thanks!

    Steve

  8. #8
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: How can the WAP browser communicate to J2ME application?

    Quote Originally Posted by stevo999999
    Jason,

    You specifically mention Sprint as having the ability to launch a Java app from a URL. What about Nokia phones offered on Sprint, then?

    I am not sure, i just found it yesterday, i.e. the link mentioning it, I had never heard of it before, but is a logical need of developers, search the web for sprint, and midlet, and platformrequest and or midlet://

    you should run into it, or I'll find the URL if you like!


    Also, someone else mentioned this possibility:
    One workaround I see is to put a link in your web page with something like "localhost:5234" and have the user click it. Your midlet would be registered with Push Registry at the very same location, and maybe it would be triggered by the browser trying to connect to a local socket.

    Does anyone agree this could tackle the issue?

    That is a fascinating idea, has anyone tried it, I have not, but might try in morning!
    Also, are you trying to stay away from the C++ daemon side, just curious, it's kinda cool integrating them.

    Sin.
    Jason Glass
    http://IChiBanComputers.Com

  9. #9
    Registered User
    Join Date
    Mar 2006
    Posts
    21

    Re: How can the WAP browser communicate to J2ME application?

    Hi Jason. Would be great if you could test this and report back!

  10. #10
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: How can the WAP browser communicate to J2ME application?

    I'll look into it, or anybody can report back if they can do it sooner, I cannot screw with it till this evening, as it is not a feature of our software, and boss would get mad at me for screwin around!

    I can put up a quick webpage somewhere though, if you need it and want to try it sooner.
    Jason Glass
    http://IChiBanComputers.Com

  11. #11
    Registered User
    Join Date
    Mar 2006
    Posts
    21

    Re: How can the WAP browser communicate to J2ME application?

    Jason, that'd be great. I was actually trying this myself using your suggestion, but I don't think I have the file URL that I need. In other words, when I just put "midlet:nameofapp", my Sprint phone says it "cannot find the content". It seems like I need to somehow know the file structure, like "midlet:downloads/applications/nameofapp". But, I really have no idea. What do you think?

  12. #12
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: How can the WAP browser communicate to J2ME application?

    did you find the URL i spoke of, with regards to midlet schema, found it again...

    Took forever to find, had to search browser histroy, can be found through normal search.

    Is like this...

    <html>
    <a href="midlet:FooBar?data_for_foobar">Launch FooBar</a>
    </html>

    http://www.sprintdevelopers.com/article12.html
    Jason Glass
    http://IChiBanComputers.Com

  13. #13
    Registered User
    Join Date
    Mar 2006
    Posts
    21

    Re: How can the WAP browser communicate to J2ME application?

    Jason, this seems to work for applications that came pre-loaded on the phone by the OEM. When I download Tetris, and put midlet:Tetris, it does not seem to find it.

    Is that what you would expect? That somehow a Java game already on the phone could be loaded but not a download game?

  14. #14
    Super Contributor
    Join Date
    Mar 2006
    Location
    Phoenix, AZ. USA
    Posts
    556

    Re: How can the WAP browser communicate to J2ME application?

    Figures, the article they had, showed an example with a developers own midlet though.

    Maybe you do need the file ur

    Did you also try rebooting, after installing, in case the AMS does not register it till later

    your idea about registering the push might work also
    Jason Glass
    http://IChiBanComputers.Com

  15. #15
    Registered User
    Join Date
    Mar 2006
    Posts
    21

    Re: How can the WAP browser communicate to J2ME application?

    How would I get the full file URL?

Posting Permissions

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