Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User jasmitvala's Avatar
    Join Date
    Mar 2006
    Posts
    10
    jhd

    hi.

    i have wrtten simple code to read data from html page using httpConnection

    with following code


    Code:
     
     private void sendHttpGet(String url)
        {
            responseMessage = new StringBuffer();
            try{
            
    
            hcon = (HttpConnection)Connector.open(url, 3);
            hcon.setRequestMethod("GET");
           
            dis = new DataInputStream(hcon.openInputStream());
            int j;
            while((j = dis.read()) != -1) 
            {
                responseMessage.append((char)j);
            }
    		
    
    	mainForm.append(responseMessage.toString());	
    
            	}
    	catch(Exception e){
    	    }
    	}
    now what is the problem is when i am runnig tis code with Nokia 6030 it will read the content from given url but when i will install same application on n3230/n7710/sony erricssion k300i

    it will establish connection but will not read content and also it will not connecting to specific url.

    it will give error message Symbain error -33 time out

    Please, any one who know the solution please help....


    Regards,
    Jasmit vala
    [FONT=Courier New][SIZE=7]JHD[/SIZE][/FONT]

  2. #2
    Nokia Developer Expert dcrocha's Avatar
    Join Date
    Jun 2005
    Posts
    923
    You don't need a DataInputStream if you're reading it this way. Just do:

    Code:
    InputStream is = hcon.openInputStream();
    
    int j;
    while((j = dis.read()) != -1) 
    {
    responseMessage.append((char)j);
    }
    Also check if you are using Internet access points, not Wap ones.

    Daniel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved