dcsimg
HttpConnection
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alfonso_Valdez
Posted On:   Monday, September 19, 2005 01:18 PM

what happend with my J2ME connection based in http? Please use html tags to format code blocks. hi, ia have a problem with my simple MIDlet conecction example. This simple MIDlet execute a connection based in http protocol, but the answer that my apliccation recive is wrong. what happend with my connection? The code of my apliccation is this: HttpConnection hc = null; try{ hc = (HttpConnection)Connector.open(url); if(hc != null) mensaje.setText("Null"); hc.setRequestMethod(HttpConnection.GET); int code =0; code = hc.getResponseCode(); forma.append("Code: "+code); DataInputStream dis = hc.   More>>

what happend with my J2ME connection based in http?


Please use html tags to format code blocks.




hi, ia have a problem with my simple MIDlet conecction example. This simple MIDlet execute a connection based in http protocol, but the answer that my apliccation recive is wrong. what happend with my connection? The code of my apliccation is this:


			
HttpConnection hc = null;
try{
hc = (HttpConnection)Connector.open(url);
if(hc != null)
mensaje.setText("Null");
hc.setRequestMethod(HttpConnection.GET);
int code =0;
code = hc.getResponseCode();
forma.append("Code: "+code);
DataInputStream dis = hc.openDataInputStream();
forma.append("String readed: "+dis.readUTF());
dis.close();
hc.close();
}catch(IOException ioe){
forma.append(ioe.getMessage());
}






for the other side my servlet use a DataOutputStream for write the answer. My Servlet write a String UTF






when i run my apliccation in my handset i obtain this:
Ño
page cannot
be displayed


if somebody can help my, please send me an answer    <<Less
About | Sitemap | Contact