×

Discussion Board

Results 1 to 3 of 3

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    1

    HttpConnection and 6310i

    Hi all
    I wrote a simple test application which connect our http server retreives some data and displaysto them to the user.
    I put every thing together (jar, jad) and put all on my server.
    After downloading the application the 6310i says it dosen't support this kind of application.
    Hire the coad:

    public class Communicator{
    public final int SIZE = 256;
    public String URL = "http://www.bridge-bde.ch";

    public Communicator()throws IOException {
    super();
    }

    public String send(){
    String reply = new String();
    try{
    HttpConnection conn = (HttpConnection)Connector.open(URL, Connector.READ);
    conn.setRequestMethod("GET"
    if(conn.getResponseCode() == HttpConnection.HTTP_OK){
    InputStream is = conn.openInputStream();
    byte[] buffer = new byte[SIZE];
    int total = 0;
    while(total<SIZE){
    int count = is.read(buffer, total, SIZE-total);
    if (count<0)break;
    total += count;
    }
    //reply = Integer.toString(total);
    is.close();
    reply = new String(buffer, 0, total);
    }
    }catch(IOException ex){
    //reply = ex.getMessage();
    //System.out.println("\nError Message:\t SENDER " +ex.getMessage());
    ex.printStackTrace();
    }
    return reply;
    }
    }

    any help is welcome
    thomas

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    382

    RE: HttpConnection and 6310i

    Hello

    If your mobile says after downloading the application
    that it does not support this kind of application.
    Then the problem must be somewhere else in your code as in this you have posted.

    Please can you post more information about your MIDlet, as jad file;
    and the whole sources.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    4

    RE: HttpConnection and 6310i

    The code you've posted doesn't actually appear to be a Midlet - I presume there is more? Would certainly help to see the contents of the jad file.

Posting Permissions

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