The difference between Android's Parcelable and Serializable

          Everyone knows that both Parcelable and Serializable can be serialized and can be used for data transfer between intents, so how to choose between them?

         Serializable is a serialization interface in JAVA. It is simple to use but expensive, and the serialization and deserialization process requires a lot of I/O operations. Parcelable is the serialization method in Android, so it is more suitable for the Android platform. Its disadvantage is that it is more troublesome to use, but it is very efficient. This is the serialization method recommended by Android, so we must first Parcelable. But the following two situations suggest using Serializable

         It is also possible to serialize the object to the storage device or to transmit the object through the network after serialization, because these two processes are more complicated, it is recommended to use Serializable.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325405693&siteId=291194637