简体   繁体   中英

Android networking

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.

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?

Thanks.

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 style, with XML or JSON data
  • JSONRPC/XMLRPC
  • SOAP (not the best for a performance standpoint)
  • Protocol Buffers over sockets (TLS/SSL, please). Consider WebSockets.

If using a light weight JAVA/RMI Android implementation is feasible for your particular scenario you can take a look at the links below:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM