- Home /
Unity and bluetooth(android) own plugin.
Hello.
I try make simple communication between two devices via bluetooth. I alread made program which should show device list but it dosent work.
BluetoothAdapter mBluetoothAdapter;
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
String returnVale ="";
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
if (pairedDevices.size() > 0) {
// There are paired devices. Get the name and address of each paired device.
for (BluetoothDevice device : pairedDevices) {
String deviceName = device.getName();
String deviceHardwareAddress = device.getAddress(); // MAC address
returnVale=returnVale+" "+deviceName;
}
}
return returnVale;
There is anyway to debug this program ? When i run it as separated program i will get device list without any problem, but in unity nothing happend.
Comment
yes, build as Development build and spiritually enable script debugging for your android device. them, you can connect mono or VS as debugger, set break points and see what's going on.