WHAT IS THE DIFFERENCE BETWEEN SERIALIZABLE AND PARCELABLE, AND WHICH ALTERNATIVE IS BETTER TO USE IN ANDROID?

Subject Android
Institute Ahsanullah Institute of Information and Communication Technology 2013

Parcelable is a class that has been specifically designed for Android, and is thus more fficient that Serializable .
Serializable just needs an interface to be implemented, being then more for th developer comfortable. It does however use reflection, and it is a slow process. It also creates a few temporary objects and there are some concerns with the garbage collector. arcelable generates, however, boilerplate code. Most of the time we will prefer it
over Serializable , but performance will come at a cost.

Login to post your comment.