Hi,
i have developed a code for Nokia 6600 to talk to Computer. the only thing where it get's stuck is the UUID stuff. i am not sure what value to specify in for the UUID and the attribute set while opening the connection to the computer via the Nokia 6600 code.
Code:
public void connect(String s)throws IOException {
String UUID = new UUID("1101",false).toString();//1101 00112233445566778899AABBCCDDEEFF
System.out.println("UUID is....."+UUID);
int discoveryMode = DiscoveryAgent.GIAC;
LocalDevice device = null;
// no paring needed
try {
device = LocalDevice.getLocalDevice();
device.setDiscoverable(DiscoveryAgent.GIAC);
String url = "btspp://localhost:" + UUID + ";name=PCServerCOMM";
System.out.println("URL is....."+url);
synchronized (this)
{
notifier = (StreamConnectionNotifier) Connector.open(url);
servRecord = device.getRecord(notifier);
System.out.println("SERVRECORD is....."+servRecord);
StreamConnection conn= notifier.acceptAndOpen();
DataOutputStream out = conn.openDataOutputStream();
out.writeUTF(s);
/*LocalDevice local = LocalDevice.getLocalDevice();
DiscoveryAgent agent = local.getDiscoveryAgent();
String connString = agent.selectService(
new UUID("1101", false),
ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
*/
/*try {
// Connect to the server and send 'Hello, World'
/* StreamConnection conn = (StreamConnection)
Connector.open(connString);
OutputStream out = conn.openOutputStream();
out.write("Hello, World".getBytes());
out.close();
conn.close();
System.out.println("Message sent correctly");
} catch (IOException e) {
System.out.println("IOException: ");
System.out.println(e.getMessage());
}
*/
}
}
catch(IOException e) {
System.out.println("IOException");
}
catch(Exception e) {
System.out.println("exception of url");
e.printStackTrace();
}
}
}
u can clearly see that i've tried lot of stuff. pls help at the earliest. thanks a million.