So as it mentioned above, the point is that you need to use the UUID that the server is waiting for.
If you are connecting to a bluetooth device, such as a headset or mouse, you need to check which UUIDs the device is listening for. You can see the UUIDs like this.
UUID uuids = bluetoothDevice.getUuids();
And if you want to know what these UUIDs mean, see this.