Android-Emulator connects to local tomcat

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.