Search code examples
javaandroidservletsobject-oriented-databaseobjectdb

What is preferable way to pass objects between server and client?


Good day. I develop server-client application with Glassfish+ObjectDB(embeded mode) on serverside and Android application on client side. What is prefreable way (with respect to traffic and security) to send data that stored as java objects in ObjectDB to android application? (Data must be encrypted.) I think about:

  • pass serializable objects through stream input/output.
  • pass data as XML/JSON format.

Or may be there is other way?

Thx for help.


Solution

  • Binary data as well has a smallest size, but is less useful. XML is self-described, but has a biggest size. If you need to send data only between your apps you can choose binary format.