开发者

Android USB communication

开发者 https://www.devze.com 2023-01-13 11:43 出处:网络
I need my app to connect to a PC via USB cable and continuously send/receive data. I wanna use ObjectInputStream/OutputStream for this.

I need my app to connect to a PC via USB cable and continuously send/receive data.

I wanna use ObjectInputStream/OutputStream for this.

  1. Is TCP 开发者_运维百科the only way?

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消