I want to communicate with my android application from my computer with the usb data cable. What listener should I implement?
I think a TCP connection will suit my needs but connecting with it over the adb driver seems akward.
How can I communicate from windows to android using a data cable?
USB accessory mode allows users to connect USB host hardware specifically designed for Android-powered devices. The accessories must adhere to the Android accessory protocol outlined in the Android Accessory Development Kit documentation.
In USB host mode, the Android-powered device acts as the host. Examples of devices include digital cameras, keyboards, mice, and game controllers. USB devices that are designed for a wide range of applications and environments can still interact with Android applications that can correctly communicate with the device.
I found a nice post about this subject here. You basically need adb in order to do the port forwarding between the Android device and the PC. As an example:
C:\android-sdk-windows\tools\adb.exe forward tcp:38300 tcp:38300
Then you can use standard socket programming, both in the Android device and in the PC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With