Serializable or Parcelable

from the CommonsWare Community archives

At May 11, 2018, 7:31pm, Shahood asked:

In EU4YouToolbar, would it b ok if we make Country implement Serializable instead of using a custom implementation of Parcelable?
Are there any specific benefits of Parcelable over Serializable?


At May 11, 2018, 8:03pm, mmurphy replied:

In EU4YouToolbar, would it b ok if we make Country implement Serializable instead of using a custom implementation of Parcelable?

If you mean “will it compile and run?”, then yes, Serializable is fine.

Are there any specific benefits of Parcelable over Serializable?

Parcelable is faster at runtime, though usually that is not a huge issue nowadays, since we rarely deal with large numbers of these. It was a bigger issue in earlier versions of Android (when reflection was slow) and on older Android devices (where devices were slow).


At May 12, 2018, 3:42am, Shahood replied:

Ok thanks for the detailed answer.