I've been following the tutorial in Creating an Endpoints Backend from an Android Project. Everything is being compiled and looks promising. The backend is up.
I changed CloudEndpointUtils#LOCAL_ANDROID_RUN
to true
. But when I try to test the app on a real device (not emulator) I'm failing on:
java.net.SocketException: failed to connect to /10.0.2.2 (port 8888) after 20000ms: isConnected failed: EHOSTUNREACH (No route to host)
So I looked at CloudEndpointUtils
and saw that setting LOCAL_ANDROID_RUN
to true
makes the app look for DevAppServer in http://10.0.2.2:8888
, which is the emulator virtual router.
But I'm not using the emulator. So I tried to change the constant holding this url to http://127.0.0.1:8888/
but still no luck. I'm now failing on:
java.net.ConnectException: failed to connect to /127.0.0.1 (port 8888) after 20000ms: isConnected failed: ECONNREFUSED (Connection refused)
I thought it might be because my PC is behind a firewall, so I disabled it, but still nothing.
Any suggestion would be appreciated.