The following code makes a connection to my server as i see it in the access file.
I know it's kind of working as I said about the access file and the device has had apn trouble for a few hours and i have gotten over that obstatcle now. I currently don't get an alert or a a log of the response from the server.
I have simply constructed a aspx page which Response.writes one sentence on the page for my j2me app to import.
Am I missing something?
Code:
String url = "*************************************************;deviceside=true;apn=wap.o2.co.uk;tunnelauthusername=o2wap;tunnelauthpassword=password"; HttpConnection connection = (HttpConnection) Connector.open(url, Connector.READ_WRITE, true); output = new PrintStream(connection.openOutputStream() ); output.println( "GET /SampleASP/MobileSearchResults.aspx?amount=1&0=5000354900716 HTTP/1.1" ); output.flush(); in = connection.openInputStream(); int ch; while( ( ch = in.read() ) != -1 ) { sb.append(in.read()); } Dialog.alert(sb.toString()); Log.info("ERROT" + sb.toString()); in.close(); output.close(); connection.close();
I have simply constructed a aspx page which Response.writes one sentence on the page for my j2me app to import.
Am I missing something?
Comment