Save parcelable class to file

I used a serializable class to store the result of the XML parser, but when I read that it is very slow on Android, I changed the class to a class.

Now I want to save the content parcelable class to a file.

How can i do this?

Thank. Regards.

+2


source to share


1 answer


According to Parquet API reference

Parse is not a general purpose serialization mechanism. This class (and the corresponding Parcelable API for placing arbitrary objects in a batch) is designed to be a high performance IPC transport. As such, it is inappropriate to put the parcel data in persistent storage: changes in the basic implementation of any of the data in the Parcel can make the old data unreadable.



Parcelable

is intended for use only IPC

and is not intended to be saved. Therefore, you need to convert your object to some persistent data structures, such as XML

, JSON

, Serializable

.

+18


source







All Articles