Transfer and parsing of JSON between Android client and server (JSP) "attached effect map with source code"

Source: Internet
Author: User

Recently, there is a project need to use the JSON transfer, not too understanding, in the Internet to find some relevant information, wrote a small demo, you can achieve the basic function: The Android client sends JSON to the server, the server uses the JSP to receive, parse and return to the client in JSON form, The client receives printing, first look at the effect of the operation, the source code will be given at the end of the article.

1. Server: After receiving the JSON to resolve the print, and then send the JSON to the client

2. Client, receive the JSON returned by the server after printing



Simple introduction of the following source:

The service side uses json.jsp to receive parsing the client passes the Json,json resolution needs to use the Lib directory the jar package, needs to use the Tomcat to run, the source directory structure is as follows:



The client is very simple, all in the mainactivity implementation, the source directory structure is as follows:





Source download point here ^ ^


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.