Eclipse builds a server for simple communication with Android

Source: Internet
Author: User

---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

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.