
Untitled
By: a guest on
Jun 20th, 2012 | syntax:
None | size: 0.77 KB | hits: 10 | expires: Never
how can i create different codes for server and client using following code
BluetoothSerialPortInfo[] info = BluetoothSerialPort.getSerialPortInfo();
try {
Dialog.alert(info[0].toString());
StreamConnection _bluetoothConnection = (StreamConnection)Connector.open( info[0].toString(), Connector.READ_WRITE );
DataOutputStream _dout = _bluetoothConnection.openDataOutputStream();
final int JUST_OPEN = 4;
_dout.writeInt(JUST_OPEN);
DataInputStream _din = _bluetoothConnection.openDataInputStream();
String contents = _din.readUTF();
System.out.println(contents);
_bluetoothConnection.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}