How to connect to my http://localhost web server from Android Emulator

前端 未结 11 1756
礼貌的吻别
礼貌的吻别 2020-11-22 02:03

What can I do in the Android emulator to connect it to my localhost web server page at http://localhost or http://127.0.0.1?

I\'ve tried it

11条回答
  •  梦毁少年i
    2020-11-22 02:19

    The localhost refers to the device on which the code is running, in this case the emulator.

    If you want to refer to the computer which is running the Android simulator, use the IP address 10.0.2.2 instead.

    You can read more from here.

提交回复
热议问题