[Android Demo] obtain today's weather conditions through WebService

Source: Internet
Author: User

Because it is engaged in. NET, and now I am studying Android, I want to implement Android to obtain data through the WebService interface. There are still some problems on the Internet. Refer to: Android uses WebService for network programming and tools to easily implement this blog. It also implements the function of getting weather conditions today through a public WebService. The implementation result is as follows:

Sometimes we need to use the WebService interface to obtain data. WebService is a SOAP-based Remote Call standard. Through webservice, we can integrate different operating system platforms, different languages, and different technologies. The Android SDK does not provide a library to call WebService. Therefore, you must use a third-party SDK to call WebService. PC-based Webservice client libraries are rich, such as Axis2 and CXF. However, these sdks are too large for Android systems and may not be easily transplanted to Android systems. Therefore, these sdks are not under our consideration. Suitable for mobile WebService client SDK has some, more commonly used Ksoap2, can be from the http://code.google.com/p/ksoap2-android/wiki/HowToUse? Tm = 2. Download the jar package and add it to the libs directory.

Bytes

The following is a diagram of the WebService method:

 

 

For more information about the code, see the example. The explanation is clearly written: WebServiceTry.zip.

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.