hey firs its aways a good idea to put httpconnection inside a thread and when you open an inptustream you have to put it inside and try and catch
for me this code always has done the job
Thread connection = new Thread(new Runnable(){
public void run(){
HttpConnection c;
InputStream is;
OutputStream out;
StringBuffer buff = new StringBuffer();
String err = null;
try{
//Connecting to server passing the data and setting the connection property
c = (HttpConnection)Connector.open(url);
c.setRequestMethod(HttpConnection.GET);
c.setRequestProperty("User-Agent","Profile/MIDP-2.1 Configuration/CLDC-1.1");
c.setRequestProperty("If-Modified-Since","9 Oct 2012 17:49:31 GMT");
c.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
c.setRequestProperty("Accept","text/html");
//Read From the File
try{
is = c.openInputStream();
//loop to read every character from file and append it to StringBuffer
int ch;
while((ch = is.read()) != -1){
buff.append((char) ch);
}
// now use the buffer will have al the data from php
}catch(Exception e){
}
}catch(Exception e){
display.setCurrent(text);
}
}
});
connection.start();
i hope this helps