Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 648
Petkovsky Avatar asked Nov 05 '10 22:11

Petkovsky


2 Answers

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.
like image 145
Yann Ramin Avatar answered Oct 05 '22 22:10

Yann Ramin


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

  • https://github.com/jorgenpt/lipermi
  • http://blog.pastelstudios.com/2012/10/11/poor-mans-rmi-android-java/
like image 32
thevilscot Avatar answered Oct 06 '22 00:10

thevilscot