Android networking
Asked Answered
L

2

6

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.

Locris answered 5/11, 2010 at 22:28 Comment(0)
A
5

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.
Asoka answered 5/11, 2010 at 22:31 Comment(2)
Well, the thing is that the whole system will function inside a local network, so it is probably safe to say that the server and clients will communicate on the same subnet. Anyway, i will look into the suggested technologies. Thank you.Locris
I personally would not use it over wireless, or in fact any system on DHCP. I've had far too many headaches of devices rebinding their IP, but RMI not.Asoka
C
3

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

Cru answered 15/10, 2012 at 11:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.