Martin Koel wrote:Many of the most interesting Android applications rely heavily on communication with a server back-end.
I was wondering what would be a good design for client-server communication.
This is a broad question. It really depends on the requirements.
There're numerous options out there:
RESTful web services (can be fairly lightweight and allow for different client types, incl. mobile devices) - I recommend using JAX-RS API and particularly its reference implementation Jersey. Also, there're several APIs that introduce specific semantics on top of RESTful design. XMPP and APP (Atom Publishing Protocol) are examples of RESTful API design.
SOAP web services (much more robust, interesting for enterprise applications which might involves complex policies) - there's a variety of Java libraries for supporting SOAP-based web services
socket-based communication (can be implemented to involve less message-processing overhead; many message encodings are possible, I recommend Google Protocol Buffers -
Furthermore, Client-server communication can be wrapped inside a library which abstracts out the actual network communication and makes it easier to connect different kinds of clients.
For development of client-server communication with Android OS on client side, I would recommend Google Data APIs where you can access Google cloud to read their data and store (some of) your data.
It's been a while since I posted the original question, but better late then never : thanks to everybody who replied!
After spending way too much time experimenting with a broad range of available frameworks (ranging from JSON implementations to plain Java object serialization using a custom socket listener solution I finally ended up using XML-RPC. Setting up both server and client side took me less than 2 hours and was really straightforward.
For everybody that is interested in applying Google Protocol Buffers (a compact and fast communication method) check out this article, which features a client/server example which compares JSON, XML and Protocol buffers:
Martin Koelowitz wrote:For everybody that is interested in applying Google Protocol Buffers (a compact and fast communication method) check out this article, which features a client/server example which compares JSON, XML and Protocol buffers: