How to access local port 8080 URL from android http get

I have a quiet web service located on a local tomcat instance.

I am trying to access the URL via get in my application, but I get the error message: host unresolved

I am trying to access this url from my Android emulator browser to confirm the connection there, and I cannot get them to them. A warning appears on the screen saying: "SD card is required to download 125562.bin"

I am not using localhost in my url, but something similar:

http://192.168.1.2:8080/service/0/12345

It returns direct json

Does anyone know why I cannot access this in an Android emulator? I can successfully use the same address from my browser as well as the iPhone, and it returns json.

Does the Android port support other ports differently than the standard port 80? The problem is that this URL has no extension?

+5
source share
2 answers

The Android emulator has a virtual router that disconnects the network of emulators from the network of host computers.

However, this router is also part of the network and allows you to access servers running on the local computer using IP 10.0.2.2.

So you should use:

http://10.0.2.2:8080/service/0/12345
+13
source

10.0.2.2 .

.

+5

All Articles