I have tried to send data to server with this code from my android application.
try {
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpP
Adding to Christine's answer:
I had a similar situation. I was trying to connect to another android device through it's hotspot. Even though they were connected in to the same network, I encountered this problem of "connect failed: ECONNREFUSED (Connection refused)".
After spoiling a couple of days on this, I realized that my client device was connected to mobile Internet also.That means, my mobile data was ON.
I turned it OFF and Viola !
Make sure you are not connected to any other networks.
Posted this in case it may help anybody.
Is your phone on the same network as the computer where you connect with the ip number? Is the server on the public internet? I get this error when I forget to put my phone on my local wifi network and it wants to connect to a server on my local network.