I need to persist a object. Unfortunately sqlite in android does not support ORM. Therefore I need to choose a different way to persist my data.
Is it better to persist the data via java serialization (ObjectOutputStream) within a blob, or via Gson’s json serialization as a json string? Afterwards I need to serialize the data again as a json string in order to transmit it to a restful wcf service.
I’m worried about the serialization speed because afaik working with strings isn’t very efficient.
In my experience serialization works faster than gson, but I haven’t done any test on it. If speed is of concern I’d recommend you to do that test yourself.
On another note, you can use ORM on java/Android, read here: Any good ORM tools for Android development?