| Author |
Client-server design - XML, Proprietary or REST
|
Martin Koelowitz
Greenhorn
Joined: Aug 06, 2005
Posts: 6
|
|
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.
- Proprietary, XML or REST
- How would the client look like and how the server (which has less limitations regarding CPU, memory, libraries, etc.)
|
SCJP 1.4
|
 |
Nenad Nikolic
Greenhorn
Joined: Mar 20, 2009
Posts: 13
|
|
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 servicessocket-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.
I hope this helps.
Cheers!
Shonzilla
|
 |
Michael Rivera
Ranch Hand
Joined: Dec 31, 2007
Posts: 115
|
|
Jetty on Android is cool
|
So many things to do so little time !!!
@mikedroid myLinkedIn
|
 |
Nenad Nikolic
Greenhorn
Joined: Mar 20, 2009
Posts: 13
|
|
Michael Rivera wrote:Jetty on Android is cool
Could you please elaborate how does you reply help Martin or anyone else interested in client-server communication in relation to Android platform?
Cheers!
Shonzilla
|
 |
Martin Koelowitz
Greenhorn
Joined: Aug 06, 2005
Posts: 6
|
|
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.
Server side: http://ws.apache.org/xmlrpc/server.html
Client side: http://code.google.com/p/android-xmlrpc/
|
 |
Martin Koelowitz
Greenhorn
Joined: Aug 06, 2005
Posts: 6
|
|
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:
http://www.ibm.com/developerworks/opensource/library/x-dataAndroid/index.html
|
 |
Nenad Nikolic
Greenhorn
Joined: Mar 20, 2009
Posts: 13
|
|
Thanks for your feedback and linking to this interesting developerworks article.
I'm curious, have you tried:
gzipping XML-RPC data and ungzipping it on the Android device?setting up and using Google Protocol Buffers in the end?
Cheers!
Shonzilla
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12271
|
|
Also note that the RESTlet project has an Android specific release.
Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: Client-server design - XML, Proprietary or REST
|
|
|