문제

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