When using Android to try to connect to the local tomcat, the discovery has not been responding. Online search of a lot of information, coupled with their own continuous testing, and later found that the simulator access to Tomcat, the concept of IP with the PC on the access to tomcat with the IP, is fundamentally different, Not to mention the real machine. If you use localhost (or 127.0.0.1) to connect to the Android emulator itself, it won't work if you connect via localhost (or 127.0.0.1). At this point ( Using the Android emulator to connect to Tomcat is possible using the Android emulator default IP (10.0.0.2), which is the alias (alias) connection of the computer.
- Genymotion after installation VirtualBox host-only network IP is 192.168.56.1, on the PC side with this address can access Tomcat
- Use 10.0.2.2 for default AVD and 10.0.3.2 for Genymotion,genymotion Access host to 10.0.3.2 access
Ref:android connection to local tomcatgrnymotion Simulator and Android Real computer access to PC-side Tomcat applications
Http://www.xuebuyuan.com/2089530.html
Android-Emulator connects to local tomcat