• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Client-server design - XML, Proprietary or REST

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.)

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

    I hope this helps.

    Cheers!
    Shonzilla
     
    Ranch Hand
    Posts: 140
    Android Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Jetty on Android is cool
     
    Nenad Nikolic
    Greenhorn
    Posts: 13
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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
    Posts: 6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
    Posts: 13
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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:

    http://www.ibm.com/developerworks/opensource/library/x-dataAndroid/index.html



    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
     
    Author and all-around good cowpoke
    Posts: 13078
    6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Also note that the RESTlet project has an Android specific release.

    Bill
     
    Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic