什么是最好的服务器端的通信协议在Android和iOS的使用?服务器端、通信协议、是最好的、iOS

由网友(逗比有理/卖萌无罪)分享简介:我们有一个服务器应用程序(Java实现),将提供一些数据,我们的移动应用程序。该应用程序将用于Android和iOS的创建。We have a server application (implemented in Java) that will provide some data for our mobile app...

我们有一个服务器应用程序(Java实现),将提供一些数据,我们的移动应用程序。该应用程序将用于Android和iOS的创建。

We have a server application (implemented in Java) that will provide some data for our mobile apps. The apps will be created for Android and iOS.

这是最好的协议/​​库用于这一目的?该协议的开销应尽可能地小。

Which is the best protocol / library for this purpose? The overhead of the protocol should be as small as possible.

感谢。

编辑:这应该是一个请求 - >应答szenario。数据丢失是不能接受的。答案可能包含一长串数据,therfore更少的开销是必需的。

It should be a request->response szenario. Data lost is not acceptable. The answer could contain a long list of data and therfore less overhead is required.

客户应请求数据(指定的键和一些definied参数)例如: 给我的文件夹X中的扩展Ÿ所有的文件。服务器则以列表中。

The client shall request the data (a specified key and some definied parameters) e.g. "give me all file from folder x that have the extension y". The server answers with the list.

第一个想法是使用XMLRPC,但所产生的反应是太大。

The first idea was using XMLRPC, but the generated responses are too large.

推荐答案

对于大多数应用程序,HTTP(S)是用最好的协议。开销(即头)是pretty的小,传输可以用gzip压缩的连接可以确保(通过SSL)。另外,端口80(HTTP)和443(HTTPS)将在99%的情况下打开。其他端口都没有 - 比如某些运营商阻止所有其他端口,除非你支付额外的

For most applications, HTTP(S) is the best protocol to use. The overhead (i.e. headers) is pretty small, the transfer can be gzipped, the connection can be secured (via SSL). Also, ports 80 (HTTP) and 443 (HTTPS) will be open in 99% of cases. Other ports are not -- for example some carriers block all other ports unless you pay extra.

至于实施,我建议 RESTful Web服务使用的

阅读全文

相关推荐

最新文章