How can I initiate an Android-to-PC HTTP request over USB?

前端 未结 5 1268
耶瑟儿~
耶瑟儿~ 2021-02-01 10:11

This has been asked before, but did not receive a satisfactory answer.

From my Android application, I need to send an HTTP request to a PC attached via USB. Typ

5条回答
  •  无人共我
    2021-02-01 10:47

    In USB it is always the host (the PC in your case) which initiates the communication. So you'll need to use tricks to appear that the Android device sends a request. The PC might periodically poll Android (say, every 100 ms) if it has a HTTP request pending and collect it accordingly, similar to what jackbot did. I guess that's what Android to USB Port Forwarding did.

提交回复
热议问题