Serializable & Parcelable class can be used to pass object references from one Activity to the other Activity via Intent/Bundle. Your object must implement either Serializable or Parcelable in order to pass it via Intent.
Serializable is defined in JAVA language as a marker interface, so after implementing Serializable no extra method implementation is needed. It is very easy to use, but the performance is not good since serializing mechanism is decided by Java and it uses refelection.
Parcelable class is provided by Android platform, and its performance is much faster than Serializable (according to this blog, it is more than 10 times faster!!). This is because the serialization method is explicitly written in Parcelable class. It means you need to implement serialization method, following 4 methods/members, which is quite troublesome.
writeToParcel()
Constructor with argument Parcel
Parcelable.Creator<> CREATOR
createFromParcel()
newArray()
describeContents()
Binder and AIDL works with Parcelable.
Using Android studio plugin to Easily implement Parcelable class
1. Open class which you want to implement Parcelable, and Press [ALT+Insert] (cursor position doesn’t matter, plugin always insert automatically generated code at the bottom of class). You can select “Parcelable”.
2. Select fields to be parceled. Usually just press OK.
3. Done! below methods are automatically generated, so easy.