i’m generating several large Hashmaps and putting them into 1 object on Windows (using Java). Now i want to transfer this object to my Android app by giving it as an Asset.
I have tried using the Java serialization, but when i unpack the object in my App, all hashmaps have null values.
My custom classes all implement Serialzable and contain basic types or other custom classes. (which contain basic types or other custom classes, and so on, the chain does end, its not a circle).
Does anybody know what could be the problem?
Or does anyone know a XMLSerializer(or other) that supports flattening private fields without getters and setters?
Google Protocol Buffers is probably today the most efficient and convenient serialization/deserialization solution on Android and can be connected to many languages platforms.
As the alternatives mentioned here are java serialization and XML, I suggest you look at the chapter in the FAQ answering Why use protobuf.
This article offers a small example of protobuf usage on android (and a kind of dubious benchmark comparison).