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

前端 未结 5 1266
耶瑟儿~
耶瑟儿~ 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:56

    If the Android phone supports USB tethering:

    1. Connect the phone through USB cable
    2. Enable USB tethering
    3. A Local Area Network connection would be created in the IP Range 192.168.142.X [The IP for this LAN can be made static as well]

    Now a web server running on the PC can be sent HTTP requests with this setup.

提交回复
热议问题