×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    2

    Http connection with Series 60 MIDP for Symbian OS emulator - no luck

    Hello there

    I've been trying to make a HTTP connection with the emulator for the Series 60 but so far without luck. If I, however, use the Nokia 7210 emulator that comes with Nokia Developer's Suite it runs perfectly.

    The Series 60 emulator hangs with a NullPointerException when it calls the HttpConnection.openInputStream() (just after I select Acces point - DirectHTTP).

    Anyone experienced similar problems?

    Best regards

    Bjoern D. Rasmussen

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    9
    i've make a HTTP connetcion with Nokia7650 and no with 7210...
    I use this code:

    HttpConnection conn = (HttpConnection) Connector.open(
    "http://www.123.com" );
    InputStream s = null;


    s = conn.openInputStream();
    ch = s.read();


    if (s != null) {
    s.close();
    }
    if (conn != null) {
    conn.close();
    }


    can u send me your code for connetion in hhtp with nokia7210? tnk's

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    2

    My code

    My code looks pretty much the same
    ----------
    public void doHttp(String url) throws IOException
    {
    System.out.println("opening socket");
    HttpConnection http = (HttpConnection)Connector.open(url);
    System.out.println("Socket opened");

    System.out.println("Getting inputstream");
    InputStream is = http.openInputStream();
    System.out.println("Got inputstream");

    System.out.println("Reading from stream");
    char c;
    StringBuffer str = new StringBuffer(1024);
    while ((c = (char) is.read()) != -1)
    if (c != 0xFF)
    {
    str.append(c);
    }
    else
    break;

    System.out.println("Finished reading from stream");
    -----------

    It stops with a NullPointerException when I call http.openInputStream();

    Have you configured the Series 60 emulator in any special way?

Posting Permissions

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