×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    J2mE http Connection problem

    Hello Friends,
    I made an application for J2ME phones...
    which is using GPRS. or WIfI

    on wifi my application work properly But on GPRS its not working properly ...

    I tried on 5 to 6 handset & change service provider also ,,,
    But still getting this is not working............

    i'm using below code.

    //////*************//

    HttpConnection HTTP_CON = (HttpConnection) Connector.open(URL,Connector.READ_WRITE,false);
    System.out.println("Link: " + HTTP_CON.getURL());
    HTTP_CON.setRequestProperty("User-Agent", "Profile/MIDP-2.0, Configuration/CLDC-1.0");
    HTTP_CON.setRequestProperty("Content-Language", "en-US");
    HTTP_CON.setRequestMethod(HttpConnection.POST);
    DataOutputStream DATA_OUTPUT = HTTP_CON.openDataOutputStream();
    DATA_OUTPUT.flush();
    DATA_OUTPUT.close();
    DataInputStream DATA_INPUT = HTTP_CON.openDataInputStream();
    ...................




    I've php server for Request & response.....

    please help me for this problem............
    thanks & Regards.
    Nilesh

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: J2mE http Connection problem

    Hi,

    I have tried your code with the following yahoo search url

    "http://search.yahoo.com/search?p=steve"

    and I am getting an HttpConnection.HTTP_OK Response Code. That part of the code seems fine.

    This could be an access point configuration issue on your phone. Can you connect to the internet and open the same url (also try different urls) in the phone's browser usin your GPRS access point and disabling entirely the WiFi?

    Maybe the problem lies a few lines below the snippet you have provided here, in the Input Stream.

    What is the exact error message on your screen and how do you retrieve the input stream?

    You can also try the Example using POST with HttpConnection found here:
    http://library.developer.nokia.com/i...onnection.html

  3. #3
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: J2mE http Connection problem

    thanx for quick reply........
    my problem get solve ...problem occurred due to I'm using POST instead of GET
    thanks & Regards.
    Nilesh

Similar Threads

  1. http connection problem in J2ME
    By nazar.ooty in forum Mobile Java General
    Replies: 1
    Last Post: 2011-07-27, 13:39
  2. http connection in J2ME
    By m_brahmin58 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2010-12-22, 11:17
  3. j2me http connection as if time out
    By asifsanli in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2010-11-11, 14:28
  4. Http connection for the j2ME application
    By saimohan in forum Mobile Java General
    Replies: 2
    Last Post: 2010-09-08, 17:55
  5. HTTP connection in J2ME hangs N73
    By massenz in forum Mobile Java Networking & Messaging & Security
    Replies: 8
    Last Post: 2009-08-26, 21:56

Posting Permissions

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