| Reply | « Previous Thread | Next Thread » |
|
Hi All!
My project involves sending a String from one Bluetooth device to another, then back again. Currenlty I have the Discovery feature working fully, searching for devices in range - the user then selects the device they wish to send the data to and this is stored as a RemoteDevice. My question is, what is the simpliest way to then send a string to the device, which will then reply automatically with another string (i.e Client/Server sort of set up, where the response from the Server will be hard coded). The following code, sets the selected remote device so how do I progress from here? I'm not really looking for anything all that clever, just simply send a string, and recieve a response. Can you do this without discovering the service's of the other device? Code:
public void setSelectedDevice() {
try {
theSelectedRemoteDevice = (RemoteDevice) theDiscoveredDevices.elementAt(theDeviceDisplayList.getSelectedIndex());
} catch (IOException ex) {
ex.printStackTrace();
}
}
Cheers!! |
| smitty350z |
| View Public Profile |
| Find all posts by smitty350z |
|
No, you have to search for the services as you have no control over its channel identifier (normally) and the channel identifier might change over time (possibly). However for the start, you might have a look at DiscoveryAgent.selectService which does device and service search in one step.
|
|
Truad
Thank for yur reply. I have the application working now by discovering the service, but I am doing this in two steps. I'll take your advice and try to simplfy it! Cheers |
| smitty350z |
| View Public Profile |
| Find all posts by smitty350z |
|
Personally, I avoid to use SelectService. I mentioned this just as a short hand alternative.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| nokia 6600 - a problem with sending data with HTTP POST | Ludwik Ejsmont | Mobile Java Networking & Messaging & Security | 1 | 2006-08-31 09:44 |
| How to activated the bluetooth interface for sending GPRS data to bluetooth printer | Loner77 | General Symbian C++ | 0 | 2004-04-12 13:22 |
| How to activated the bluetooth interface for sending GPRS data to bluetooth printer | Loner77 | Symbian User Interface | 0 | 2004-04-12 13:21 |
| Sending large amounts of data via bluetooth | j1978 | Symbian Networking & Messaging | 2 | 2004-01-12 04:40 |
| sending data from computer to midlet | Strunker | Mobile Java General | 4 | 2003-08-26 01:27 |