How to send an HTTP request to android emulator

I created a small http server in android, the code from this link was just copied to eclipse. http://www.java2s.com/Open-Source/Android/Samples/android-jp-kobe/net/cattaka/teamredwhite/HTTPServer.java.htm

How to send a simple request from browser to server now? For example, I would like, for example, 127.0.0.1:12345?x=100&y=50. Browsers always say that he did not establish a connection with this URL. When creating the main activity, I just created a server with port 12345 and ran .listen ()

+3
source share
1 answer

127.0.0.1 on is your local computer, not an emulator.

The emulator has its own network address space :

, 10.0.2.15, " / ", . http://10.0.2.15:12345?x=100&y=50.

0

All Articles