Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.


What is Serializable and Parcelable in Android?

Ashish Bisht Offline referral


Hi everyone, i have been working on Android project and want to know your views on Serializable and Parcelable. Which is best approach in Android that will be helpful for me ?
LaurenA Offline referral

Posts: 391
Joined: Sep 2015
Reputation: 7

Senior Member
Parcelable and Serialization are used for marshaling and unmarshaling Java objects. Differences between the two are often cited around implementation techniques and performance results.

Parcelable is well documented in the Android SDK; serialization on the other hand is available in Java. It is for this very reason that Android developers prefer Parcelable over the Serialization technique.

In Parcelable, developers write custom code for marshaling and unmarshaling so it creates less garbage objects in comparison to Serialization. The performance of Parcelable over Serialization dramatically improves (around two times faster), because of this custom implementation.

Serialization is a marker interface, which implies the user cannot marshal the data according to their requirements. In Serialization, a marshaling operation is performed on a Java Virtual Machine (JVM) using the Java reflection API. This helps identify the Java objects member and behavior, but also ends up creating a lot of garbage objects. Due to this, the Serialization process is slow in comparison to Parcelable
Ashish Bisht Offline referral


Nicely explained. Thank you LaurenA for valuable suggestion.
rahhulkumar1 Offline referral

Posts: 53
Joined: Oct 2015
Reputation: 1

Parcelable is much faster than serializable with binder, because serializable use reflection and cause many GC
Ashish Bisht Offline referral


thanks rahhulkumar1.

User(s) browsing this thread: 1 Guest(s)