Hi,
You have show how you select and filter services but really you need to look at the devices.
discoveryAgent.searchServices(null,uuidSet,rtDevice,this);
How you build up your remote device vector and how you select each address is critical to getting this going.
rtDevice should be the remote device that you selected out of all the addresses.
If this is the first or only address your program (the other phone) then it will always connect to that bluetooth address.
PHP Code:
Vector remoteDevices = new Vector();
DiscoveryAgent discoveryAgent;
LocalDevice localDevice = LocalDevice.getLocalDevice();
discoveryAgent = localDevice.getDiscoveryAgent();
public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass cod) {
remoteDevices.addElement(remoteDevice);
}
You now have to provide away way for the user to select the right device using a loop to display each element with the BT functions.
String rtDevice.getFriendlyName(true)
and
String rtDevice.getBluetoothAddress()
Jim