What is preferable way to pass objects between server and client? <p>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:</p> <ul> <li>pass serializable objects through stream input/output.</li> <li>pass data as XML/JSON format.</li> </ul> <p>Or may be there is other way?</p> <p>Thx for help.</p>