androidandroid-bluetoothunity-game-enginegear-vr

How do I send data from Unity gear VR app over bluetooth?


I am new to Unity and android app development. I recently got hold of a Samsung gear VR and galaxy S6.

I am able to make simple scenes and run them using the gear VR. However for my project, when I am running the app on my gear VR, I would like to send data regarding the player coordinates, joystick etc over the phones Bluetooth so that it can be read on my computer in Matlab in real time.

I need this data to trigger an external device using Matlab.

Any help would be appreciated.

Thank you


Solution

  • You need Bluetooth plugins on both sides because Unity does not support this out of the box. You can write one for yourself with Android Bluetooth API or use this cheap one that only cost $10.

    On the computer side/Windows, you can use Winsock RFCOMM. You can get sample code here. Other important links. Bluetooth tutorials on Windows.