connect failed: ECONNREFUSED

前端 未结 2 711
小蘑菇
小蘑菇 2020-12-04 15:48

I am developing one app, and what I think I wanna do is receive data from server database in android. So I started to run some tutorials. I found one that is doing pretty mu

相关标签:
2条回答
  • 2020-12-04 15:50

    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

    0 讨论(0)
  • 2020-12-04 15:52

    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..

    0 讨论(0)
提交回复
热议问题