-3

I have bunch of data like Model classes, Array list & some other data type based on requirements.

Now, I am planning to start flexible & light weight way to communicate with activities & fragments with heavy data which should not be affect to UI.

Akash Patel
  • 218
  • 2
  • 10
  • Parcel has more performance than Serializable. You can learn more about them here https://android.jlelse.eu/parcelable-vs-serializable-6a2556d51538 – Jaisel Rahman Oct 22 '18 at 08:40

1 Answers1

1

Parcelable is better because in Serializable java reflection is used which is a slow process. Serializable creates a lot of temporary objects and thus creates a lot of garbage collectable variables. Whereas in Parcelabe we will be defining explicitly the variables and methods, this takes up a bit of time but it is worth it.

theanilpaudel
  • 3,348
  • 8
  • 39
  • 67