
Android Serializable vs Parcelable
We all have heard about the Android Serializable vs Parcelable . Here you can get the complete information about serializable and parcelable. During the development of an application, we need to move or transfer data from one activity to another. But we cannot do this directly and the data must be included into a corresponding Intent object. So, we need to perform some additional actions in order to make that object suitable for a transfer and our data must be either Serializable or Parcelable.
Serializable
Serializable is a standard Java interface. It is not a part of the Android SDK but simple and easier to implement. You just need to implement Serializable interface and add override methods. As, serializable is a marker interface, there is no need to implement any extra methods.
But there is a problem with this approach is that reflection is used that slow down its process. This method also create a lot of temporary objects garbage collection that results in poor performance.
Example
Let us take an example that shows how to implement this interface.

Parcelable
Parcelable process is much faster than serializable. It is a part of the Android SDK and was designed in such a way that there is no reflection while using it. Because we are being explicit about the serialization process instead of using reflection.
Parcelable interface takes more time for implementation as compared to serializable interface and its array can be pass via Intent in android.
Example
Let us take an example that shows how to implement Parcelable interface.
