...
String url = serviceRecord.getConnectionURL( record.NOAUTHENTICATE_NOENCRYPT, false);
// open a connection to the server StreamConnection connection = (StreamConnection) Connector.open(url);
// Send/receive data
try { byte buf[] = new byte[200]; String msg = "Test message"; InputStream is = connection.openInputStream(); OutputStreamos = connection.openOutputStream(); // send data to the server os.write(msg.getBytes); // read data from the server is.read(buf); connection.close();
} catch(IOException e) { e.printStackTrace();
}
... |