What is the difference between Serializable and Parcelable? Which is the best approach to Android?

1 votes
186 views
Harsh kumar srivastava asked 10-Jan-2018 in Technology by Harsh kumar srivastava

What is the difference between Serializable and Parcelable? Which is the best approach to Android?

1 Answer

1 votes
Prateek sharma answered 10-Jan-2018 by Prateek sharma

serializable is a slow process whereas parcelable is a fast process.

while implementing the serializable interface the method are overridden which creates lots of objects which may cause quite large garbage storage. this somehow slow the overall process. 

parcelable is a little complex to implement as compared to the serializable interface. 

parcelable can be a good approach to android because it is fast and the  parcelable  Array can be passed with the use of intent which becomes easy to use.