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.

有帮助吗?

解决方案

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.

其他提示

You can try Protobuf http://code.google.com/p/protobuf. Less traffic and easy to be integrated.

In my project I am doing the first approach.

  • pass serializable objects through stream input/output.

This means I doing "file" uploads resp. downloads. However, with this approach your are bound to use Java on both sides (server and android) which is not an issue in my case

Your second approach will generate to much overhead

Encryption should NOT be done on this level. Better use HTTPS

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top