My application requires me to store sets of bits along with some accompanying metadata on the Android platform (read only for now). Now obviously I could just implement the Serializable interface, but I hear it's very slow on Android (I can imagine has to do something with the custom VM and compiler that makes such reflective features inefficient). Should I:
- Use Android's Parcel system which seems to be an "assisted" marshalling technique.
- Use a custom binary format (maybe BMP style with the header information stripped).
- Store into an XML file manually, use XML parser to retrieve data.
Now from what I understand XML serialization or parcelization isn't really backwards compatible on Android? The appeal of XML is of course that these persistent files could be edited in a regular text editor. Which leaves me in a difficult position, since I hate writing code that is redundant.
At this point I am heavily leaning towards the first option (i.e. bitset being parcelized). Any experienced Java/Android programmers care to tell me how well I can expect this to perform? Would I have to expand the bitset into an array of booleans to get acceptable runtime performance? Of course the problem with this is that even a rudimentary benchmark would have to be run on the Dalvik VM since I can't expect Sun's VM on x86 have similar performance to Android on ARM. How does the Android emulator work? Is it a VM on top of the x86 host or does it emulate the ARM instruction set and run the VM targeted at ARM?
I hope this ADD post didn't confuse everyone because it confused me. :D