connect failed: ECONNREFUSED

雨燕双飞 提交于 2019-11-27 17:49:24
laalto

To access your PC localhost from Android emulator, use 10.0.2.2 instead of 127.0.0.1. localhost or 127.0.0.1 refers to the emulated device itself, not the host the emulator is running on.

Reference: https://developer.android.com/studio/run/emulator-networking#networkaddresses

For Genymotion use: 10.0.3.2 instead of 10.0.2.2

if you are using genymotion then go to command prompt type ipconfig -find for Ethernet adapter virtualBox host-only network: -find for Ipv4 Address..............192.1**.**.* copy

http://192.1..*/foldername/filename/filename.json or filename.php

to check if its working go to browser in emulator copy paste the url you should find the file which you are looking in your browser..

Sorry for English.. This worked for me hope this might help some one.. Thank u..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!