Android USB communication
I need my app to connect to a PC via USB cable and continuously send/receive data.
I wanna use ObjectInputStream/OutputStream
for this.
Is TCP 开发者_运维百科the only way?
Is the only way to have ADB installed and use ADB forward for this? Can't I transfer data without the user to have ADB installed?
you can take help of USB tethering in this case. enable the tethering feature and listen on paricular socket. (If you are using USB tethering, you must turn that off before you can use USB to transfer files between your phone and computer.)
You can switch Android device to a accessory mode and then communicate via USB endpoits.
精彩评论