---restore content starts---
Goal: Enable simple communication between the client (Android App) and the server (PC)
Related preparations: Eclipse_mars, TOMCAT8, Android Studio
Realize:
1.java environment configuration;
2. Install TOMCAT8: I use the installation version, directly from the official website download the ZIP format of the installation package, will be extracted in the fixed path, note that the entire decompression path do not have Chinese. One problem is that there is no need to configure the environment, I use 8 and no environment configuration can also be used;
3. Eclipse new Web project: Set up the project to use the Tomcat and Jre,tomcat selection 8,mars up to 8, if you want to use 9, please Baidu how to Tomcat9 disguised as 8, there is a solution;
4. Server and client code writing: http://blog.csdn.net/u010838555/article/details/47168281, can read this blog, written in very detailed.
Problem:
1: After booting Tomcat through Bin/startup.bat, remember to Shutdow.bat and make sure the service is stopped.
2: The way the Tomcat service is started in a Web project is not initiated through the Bin folder, but through Eclipse's servers.
3: In the real machine test, about how to establish a socket connection, you can refer to http://blog.csdn.net/fantasy_lin_/article/details/53913646
4: After the code implementation, when debugging to note that the Android project needs to add network access rights-"<user-permission android:name=" Android.permission.INTERNET "/>
Eclipse builds a server for simple communication with Android