2

I am trying to develop a remote-kind App in Unity for a Android tablet. I have a finished Desktop application which I want to control.

Right know I have a normal network client/Server connection between the two apps, but I dont want to rely on a available Wificonnection.

Now I want to replace this connection, with a direct Cableconnection. If the tablet is connected via USB with the Desktoppc, the PC should know if the remoteapp is running and should get commands from the tabletappication.

Is there any way, to access those data coming from the USB-cable in Unity?

Thanks for helping

lynxSven
  • 555
  • 1
  • 10
  • 27

1 Answers1

0

This is possible and at the-same time complicated. You need a way to communicate with the Android and the driver on the computer and this is usually done with C++ on the Desktop Side.

Android:

You need UsbManager and UsbAccessory on the Android side to commucate with the Desktop.

On the desktop, you need WinUSB to be able to communcate with the Android device.

The correct way to do this is to build a simple C++ WinUSB app on the Desktop side then build another simple Java/Android App with UsbManager and UsbAccessory, then make them communcate with each other,

Once it starts working, then you can convert the Java code into jar/aar plugin and then convert the Windows C++ app into functions and into plugin/dll.

iOS:

If you decide later on to port this to iOS, you can use libimobiledevice with C++ on the desktop and External Accessory framework on the iOS side. You may need to join the Apple MFi program to be allowed to use the USB port on the iOS devices.

Programmer
  • 121,791
  • 22
  • 236
  • 328