什么是Android的一个Web服务? [英] what is a web service in android?

查看:130
本文介绍了什么是Android的一个Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何一个可以告诉通过Web服务在anddroid确切意思。每次我在哪里能够找到如何调用webvservice使用不同的协议。但我不明白究竟是什么的Web服务。

Can any one tell what exactly meant by web service in anddroid. Every where am able to find how to call webvservice using different protocols. but am not understanding what exactly a web service.

推荐答案

Web服务是类似在这个意义上的网页,您通过使用HTTP Web访问它们。所不同的是,你通常得到的原始数据备份,而不是presentation页面。例如,你可能会得到一排记录回来就好地址。因此,传输层是HTTP。对于Android的数据通常会是EN codeD的JSON或XML。你可以使用的HttpClient或URLConnection的访问服务。通常情况下,你可以在浏览器中测试Web服务,看你得到了什么回来,你通常会看到JSON或XML格式的数据。对于JSON你使用一个库像simple_json提取到Java对象。 XML是使用SAX解析器通常处理。他们真的很容易使用。

Web Services are similar to web pages in the sense that you access them over the web using HTTP. The difference is that you are typically getting raw data back instead of a presentation page. For example you might get a row of records back like addresses. So the transport layer is HTTP. The data for Android is typically going to be encoded in JSON, or XML. And you can access the service using HttpClient or URLConnection. Often you can test a web service in a browser to see what you are getting back and you will usually see JSON or XML formatted data. For JSON you use a library like simple_json to extract into java object. XML is usually processed using a SAX Parser. They are really quite easy to use.

这篇关于什么是Android的一个Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆