Connecting Tech Pros Worldwide Help | Site Map

A simple exchange of 5 words server to mobile

Familiar Sight
 
Join Date: Nov 2007
Posts: 153
#1: Aug 3 '09
The following code makes a connection to my server as i see it in the access file.

Expand|Select|Wrap|Line Numbers
  1. String url = "*************************************************;deviceside=true;apn=wap.o2.co.uk;tunnelauthusername=o2wap;tunnelauthpassword=password";
  2.             HttpConnection connection = (HttpConnection) Connector.open(url, Connector.READ_WRITE, true);
  3.  
  4.             output = new PrintStream(connection.openOutputStream() );
  5.       output.println( "GET /SampleASP/MobileSearchResults.aspx?amount=1&0=5000354900716 HTTP/1.1" );
  6.       output.flush();
  7.         in = connection.openInputStream();
  8.        int ch;
  9.        while( ( ch = in.read() ) != -1 )
  10.       {
  11.          sb.append(in.read());
  12.        }
  13.        Dialog.alert(sb.toString());
  14.        Log.info("ERROT" + sb.toString());
  15.        in.close();
  16.        output.close();
  17.        connection.close();
  18.  
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?
RedSon's Avatar
Site Moderator
 
Join Date: Jan 2007
Location: America
Posts: 3,387
#2: Aug 4 '09

re: A simple exchange of 5 words server to mobile


Moved from mobile.
Reply