Android connection to localhost

前端 未结 9 493
囚心锁ツ
囚心锁ツ 2020-12-01 11:23

I\'m trying to connect my android application to a local host url thanks to wamp server but it doesn\'t work. My goal here, is to fetch json data and parse these data. For m

9条回答
  •  無奈伤痛
    2020-12-01 11:47

    I assume you are trying to access web service available on your PC from either an android simulator or a real device.

    For an android emulator, you must NOT just use "localhost", because "localhost" means android emulator itself, NOT the host PC.

    you need modify the /etc/hosts file or the simulator or real device. add a line like "192.168.0.100 service.local".

提交回复
热议问题