Data interaction for Android and. NET APIs

Source: Internet
Author: User

One,. NET API

The General page is an. aspx file, because the. aspx file is formatted with HTML, we pass data in JSON format, so the HTML page format has an effect on the JSON format, so we don't write web-api to use. aspx pages. Instead, use the General application window interface:. ashx file.

Second, the request method:

In general, our. NET-side response requests are the same as the Android side, with 2 different ways: Get/post,

Get request, received information such as: aaa.aspx?id=123&xx=88&yy=99, through the background Aaa.aspx.cs response request. It exposes information.

Post request, the way the page responds: For example, the response in our <from></from> page. No back-exposure information

Third, the API specific format example

Create a new. ashx file, such as:

Figure 1: To ignore the difference between get/post, directly get the value of the ID (not recommended!!! );

Figure 2: Indicates the post page gets the request, gets the value of the ID;

Figure 3: Represents the Get GET request, gets the value of the ID;

Figure 4: Indicates the response processing after the acquisition, including database query, JSON inverse parsing and so on;

Figure 5: Indicates that the background processing is good after the content to return;

Figure 6: Represents the format returned by the background as a JSON data string.

Iv. contents of the Andoriod end:

The andriod side only needs to be connected via HTTP, and then the data obtained by JSON parsing can be used with the relevant features.

Data interaction for Android and. NET APIs

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.