Serializing Android Bundle for network and/or persistent storage? -
I need to sort a broader application (game) status to be transmitted over the network or saved on disk And is retrieved later.
The bundle, of course, is used to save / restore states in many uses cases, so their use would be ideal. However, for some reasons, the bundle is not sysalizable.
Searching for solutions has changed the bundle into parcel and has received an unacceptable hack and then it has to be martial, but it is not an acceptable solution because there is no guarantee that after a date or a remote device It would be possible to add data to
That's because now it looks, get all the keys bundle, every single thing from the only solution, make a huge switch / case on each object. Manually create a huge byte buffer or similar data, with the size and type of information, the side to completely rearrange the whole thing on the other hand.
Not quite right.
Does anyone know better? Perhaps someone has already created a utility function for the bundle that does this?
Great question! I wonder if you need to get the full bundle or just be in the information? Perhaps you only need information that you can save in any type (string, list or array). Take a look at subclasses, which is too big
Comments
Post a Comment