serialization in android with a client server architecture
I'm implementing a server using netbeans, as it is the IDE I feel most comfortable with. However the server accepts multiple android clients ( for the android part I'm using Motodev by Eclipse).
I ha开发者_运维技巧ve the same class (which is being serialized) on both client and server. Is it possible to serialize objects from the client side to be recognized by the server and vice-versa? I'm using Object streams and when I tried to cast the object received from the stream, an exception (incompatible types) occurred. Is there a way to prevent this since it is the exact class?
I like to use XStream.
http://x-stream.github.io (XStream is a simple library to serialize objects to XML and back again.) http://jars.de/java/android-xml-serialization-with-xstream
精彩评论