×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24

    Question HTTP connections from j2me app not working on emulator SDK 2.0 for Series 40

    Hi everyone,

    I have this application which connects to a server on the internet thru HTTP. I use HttpConnection class to do so, but it does not do anything when I open the connection to the server on the Nokia 6230 emulator. I'm using Sun's WTK 2.2 to develop on that platform, the defaultcolorphone works OK. I've also tried the Http demo application which is packaged with the WTK "Demos" suite. I'm pretty sure the code is OK as it works on actual Nokia Series 40 devices (i.e. the 5140, 3220, etc.).

    Has anyone got the answer to this? Any workaround? Am I missing some configuration I should do on the emulator? I'm using an ADSL connection and I'm not behind any proxies. Like I said, the default emulators in WTK work OK and so do the actual devices I've got.

    I've also snooped the connection with Ethereal to try some debugging but I can see that there's actually no attempts to open sockets to the destination server.

    Any help is worthy as I seem to have met a dead end

    Thanks in advance,

    Mario.

  2. #2
    Registered User
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24

    Re: HTTP connections from j2me app not working on emulator SDK 2.0 for Series 40

    When setting an HTTP proxy on the emulator's preferences, I can see there's some attempt to generate connections to it using Ethereal.
    I can see the connections come from my local IP address which is useless in the internet of course.

    So, first problem, the emulator apparently badly chooses that IP instead of the public IP my ISP assigns to my ADSL modem.

    Then I had this idea: if I can see connection attempts from my internal address trying to get thru - at least that's what Ethereal can show - then I can use an HTTP proxy set up locally so the emulator would just try to make a connection to a local address (which would be fine) and then the proxy would make it up for me.

    Ok, I found a little http proxy written in Python, very simple, non intrusive, so I know exactly that the proxy isn't adding any obscure actions that might turn into additional unexpected behaviour from the emulator. (http://mail.python.org/pipermail/pyt...ne/168957.html)

    This proxy spits the http GET/POST methods and params out to console so you can see what's going on. Unfortunately, when I configured the 6230 emulator to go thru 127.0.0.1:8000, I see the proxy doesn't even laugh at it. Umh.

    So, I ran out of ideas again.

    The only thing I'm sure of, is that the emulator is somehow making connections in a way that it selects (as the origien IP address)the IP address my ethernet adapter has, instead of choosing that of the PPP adapter -- the ADSL modem driver's IP address.

    Here's an ipconfig ouput (sorry for the spanish, but it's pretty clear anyway):

    Configuración IP de Windows 2000

    Ethernet adaptador Conexión de área local 2:

    Sufijo DNS específico de la conexión. :
    Config. automática de dirección IP. . : 169.254.22.107
    Máscara de subred . . . . . . . . . . : 255.255.0.0
    Puerta de enlace predeterminada . . . :

    PPP adaptador WinPoET v6.6 Conexión:

    Sufijo DNS específico de la conexión. :
    Dirección IP. . . . . . . . . . . . . : 201.255.135.181
    Máscara de subred . . . . . . . . . . : 255.255.255.255
    Puerta de enlace predeterminada . . . : 201.255.135.181



    Any help out there?

    Thanks,
    Mario.

  3. #3
    Registered User
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24

    Thumbs up Re: HTTP connections from j2me app not working on emulator SDK 2.0 for Series 40

    Ok guys!

    Now it worked! But only when doing the following:

    1) Don't attempt to make WTK launck the emultaor. Launch it yourself from Start->Programs-> etc
    2) I actually NEEDED the local python http proxy and set the preferences on the emulator to go through it.


    Ok finally I can happily do some debugging on the emulator!.

    Thanks to anyone who intended to help (?) and hope this is useful for someone else in trouble.

    Regards,
    Mario.

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    6

    Re: HTTP connections from j2me app not working on emulator SDK 2.0 for Series 40

    hi mario,

    is it possible for u to do a screenshot of the preferences so that we can refernce to it..

    Thanks

    Cheer clement

  5. #5
    Registered User
    Join Date
    Jan 2006
    Location
    Argentina
    Posts
    24

    Re: HTTP connections from j2me app not working on emulator SDK 2.0 for Series 40

    Sorry for the delay; I'm not sure how can I upload the screenshot?

    Anyway, it's quite easy to configure the emulator networking options:

    In the context menu of the emulator window, click Tools, then PReferences, then go to the Networking section, check the "Use an HTTP Proxy server" checkbox, then write address 127.0.0.1 (localhost) and port whichever port you've configured your proxy. In the special case of the python http proxy which I've posted the url, the default is port 8000 (of course you can change that manually when executing the proxy from the command line).

Similar Threads

  1. Launch J2ME App
    By sjb343 in forum Symbian
    Replies: 1
    Last Post: 2007-04-11, 08:24
  2. how to download j2me app to phone ?
    By garyshi in forum Mobile Java General
    Replies: 3
    Last Post: 2003-06-27, 23:37
  3. Http connections jamming my application
    By tangxj in forum Mobile Java General
    Replies: 1
    Last Post: 2002-12-31, 17:12
  4. J2ME 7650 how to test app
    By shahzad73 in forum Mobile Java General
    Replies: 0
    Last Post: 2002-08-09, 13:06
  5. Network-aware J2ME app on 6310i using VoiceStream operator
    By sandie_quinn in forum Mobile Java General
    Replies: 5
    Last Post: 2002-06-05, 10:02

Posting Permissions

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