tags:

views:

194

answers:

1

i have developed an application in j2me, it is working fine in latest nokia models. But i am facing problem with model 3110. Problem Description: in my application i used http connection. it is not getting fired in nokia3110 mobile. while i am trying to fire it is getting hanged

Here is the sample code:

http1 =(HttpConnection)Connector.open("http://128.22.0.27:8080/TestServlet/ServletFundHouse?fname="+ fname);

http1.setRequestMethod(HttpConnection.POST);

in1 = http1.openInputStream();

int ch;

long len = http1.getLength();

System.out.println("connection.getLength()1" + len);

StringBuffer sb = new StringBuffer();

if (len != -1) {

for (int i = 0; i < len; i++) {

if ((ch = in1.read()) != -1) {

sb.append((char) ch);

System.out.print((char) ch);

} else {

while ((ch = in1.read()) != -1) {

sb.append((char) ch);

System.out.print((char) ch);

}

}

}

}

Please give me solution for this problem

A: 

Have you debugged any further to see where it hanging? Where is this code called from in your Midlet?

KevinD