Serialization is converting data from a fast, efficient, internal representation to something that can be kept in a persistent store or transmitted over a network. Converting data to its serialized form is often called marshaling it. Converting it back to its live, in-memory representation is called deserializing or unmarshaling.
Exactly how data is serialized depends on the reason for serializing it. Data serialized for transmission over a network, for instance, may not need to be legible in flight. Data serialized for storage in a database, however, will be far more useful if the representation permits SQL queries that are easy to construct and make sense. In the former case the serialization format might be binary. In the latter it is likely to be labeled text.
The Android environment addresses four common uses for serialization:
Unlike larger devices—laptop and desktop machines, for
instance—Android devices cannot count on being able to swap an
application to a fast backing store when that application
becomes inactive. Instead, the framework provides an object
Bundle. When an
application is suspended it writes its state into the
Bundle. When the
application is re-created the Android Framework promises to
supply a copy of the same
Bundle during its initialization. An
application must be able to serialize anything it wants to keep
across its suspension and to store the serialized version
In addition to the immediate ...