Hi using retrofit api call method but am using local ip address still am not get proper response. if i tested in postman i got correct json response but in android studio am facing this connection issue.
Error…>
HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /192.168.1.52 (port 5000) from /192.168.1.54 (port 58978) after 60000ms: isConnected failed: ETIMEDOUT (Connection timed out)
2
Answers
I had this problem before and I remember that if you have your server running in the same network as the app you need to use 10.0.2.2:{PORT} or the laptop network IP (in case you run it on a real device).
So your endpoint in your case should be :
Check please that is not problem with your Firewall sometimes you have to allow access (restarting PC would be enought to know if it’s the problem)
It can be that firewall on your pc blocks the connection.
Or you have bound your server to localhost/127.0.0.1.
Do not bind your server to an ip address.