Json transmission and resolution between the Android client and the server (jsp) [with source code]

Source: Internet
Author: User

Recently, a project needs to use json transmission. I didn't know much about it before. I found some related information on the Internet and wrote a small demo to implement the basic functions: the android client sends a json message to the server. The server receives the message in jsp format and returns it to the client in json format. The client receives the message and prints the message. The source code is provided at the end of the article.

1. SERVER: parse and print the received json and then send the json to the client.

2. The client receives the json returned by the server and prints it.



A Brief Introduction to the source code:

The server uses json. jsp to receive the json received by the parsing client. For json parsing, the jar package under the lib directory must be used and tomcat should be used for running. The source code directory structure is as follows:



The client is simple and implemented in MainActivity. The source code directory structure is as follows:

Download point here ^


Related Article

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.