On the server side, when you call the appropriate listen function, pass it the UUID.
On the client side, call startDiscovery() and listen for the discovered devices. For each device found, get the BluetoothDevice object and call getUUIDs() to get the UUIDs that the remote device implements. Check for a match with UUID.equals().