Android的网络 [英] Android networking

查看:106
本文介绍了Android的网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在实施一个断绝客户端架构和一些客户端应用程序都应该Android操作系统上运行。浮现在脑海的第一个想法是用java RMI,但RMI API显然不是为Android实现。

We are implementing a sever-client architecture and some of the client apps are supposed to run on android OS. The first idea that came to mind was to use java RMI, but the RMI api is obviously not implemented for android.

所以, 1)有没有一种方法使用java RMI API在Android应用程序?我可以只从标准的Java库中导入了吗? 2)什么是可能的替代RMI将同时适用于Android和桌面应用程序?

So 1) Is there a way to use the java RMI api in an android application? Can I just import it from the standard java library? 2) What are the possible substitutes for RMI which will work for both android and desktop applications?

感谢。

推荐答案

RMI是什么不是停留在同一子网上的不好解决。其可怕的从故障中恢复,并与漫游客户端。

RMI is a bad solution for anything not stuck on the same subnet. Its terrible at recovering from failures, and with roaming clients.

有一吨的可能的解决方案,并不限于

There are a ton of possible solutions, not limited to

  • 在HTTP REST风格,以XML或JSON数据
  • JS​​ONRPC / XMLRPC
  • 在SOAP(不是最好的性能的角度看)
  • 在Protocol Buffers的通过套接字(TLS / SSL,请)。考虑的WebSockets。

这篇关于Android的网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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