×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    3

    Question Problem with the HttpConnection Nokia Series 40

    hello everybody !!!

    I have problem with the HttpConnection in the platform Nokia Series 40 5th Edition SDK.

    While trying to access the URL I receive this message:
    ' Error In HTTP Operation '.

    Already in other platforms does not it happen.
    Why?

    Thanks!!!

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Problem with the HttpConnection Nokia Series 40

    Check the URL encoding, check the internet connectivity of the emulator S40 5th SDK - by trying the SDK browser.... try running WTK examples.
    Thanks,
    Ekta

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Problem with the HttpConnection Nokia Series 40

    Hi luizacioly Welcome to Forum Nokia Discussion Board

    In the http operation what are you doing ? Are you posting some data to server ? Can you elaborate your problem so that people can understand your problem and give some good suggestion where you are making the mistake , And possible post the sample code.

  4. #4
    Registered User
    Join Date
    Jul 2010
    Posts
    3

    Re: Problem with the HttpConnection Nokia Series 40

    Hi Bhanu obliged by the help.
    The problem is that the HttpConnection this one producing an exception in the hour of carrying out the connection.
    Only it happens in the Nokia Series 40, if executed in the WTK 2.5.2 it executes normally without any exception.
    Down it follows the code:

    private class Connection extends Thread {

    public void run() {
    try {
    String url = "http://localhost/rota.txt";

    HttpConnection con = (HttpConnection) Connector.open(url);

    int status = con.getResponseCode();

    if ( status == HttpConnection.HTTP_OK ) {
    getGgStatus().setMaxValue( (int) con.getLength() );
    InputStream in = con.openInputStream();
    int inc = 0;
    int read = in.read();
    while ( read != -1 ) {
    inc++;
    getTbMain().setString( getTbMain().getString() + (char) read );
    getGgStatus().setValue( inc );
    read = in.read();
    }
    switchDisplayable( null, tbMain );
    } else {
    tbMain.setString( "Error: " + status );
    switchDisplayable( null, tbMain );
    }
    } catch (IOException ex) {
    tbMain.setString( "Error: " + ex.getMessage() );
    switchDisplayable( null, tbMain );
    }
    }
    }

    //Thanks.

  5. #5
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: Problem with the HttpConnection Nokia Series 40

    Hi luizacioly,
    The problem is that the HttpConnection this one producing an exception in the hour of carrying out the connection
    I don't understand this statement what does it means ?

    And one more thing is I don't see any where in you code You have not taken care about the closing your http connection and the input stream.

    For more information on Http connection plese refer forum nokia wiki page

    For your reference

    http://wiki.forum.nokia.com/index.ph...tps_in_Java_ME
    http://wiki.forum.nokia.com/index.ph...est_in_Java_ME
    http://blogs.forum.nokia.com/index.p...articleId=282&

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

    Re: Problem with the HttpConnection Nokia Series 40

    When you say that this is not working S40 5th edition, then do you mean that device or the emulator?
    Please make this sure
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Jul 2010
    Posts
    3

    Re: Problem with the HttpConnection Nokia Series 40

    What it happens the next thing is:

    If the Nokia will be connected in the Internet not of the error ' NullPointerException '.
    But, if the Nokia is not connected in the internet, the HttpConnection returns the error ='NullPointerException'
    and the Nokia does the connection with the Internet.

    Someone knows why??


    Andre

Similar Threads

  1. Replies: 5
    Last Post: 2010-09-27, 17:16
  2. series 40 problem with forms and httpconnection
    By sakura7 in forum Mobile Java General
    Replies: 4
    Last Post: 2007-06-27, 11:46
  3. Series 40 (Nokia 6133) HttpConnection
    By prajwol123 in forum Mobile Java Tools & SDKs
    Replies: 10
    Last Post: 2007-03-16, 17:37
  4. Problem with Nokia Series 40 Theme Studio.
    By abhik01 in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2005-06-06, 18:53

Posting Permissions

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