- Forum posts: 251
Jun 28, 2016, 8:13:51 PM via Website
Jun 28, 2016 8:13:51 PM via Website
Ashish Bisht
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 ?
Serializable
- standard Java interface
- implement the Serializable interface only
- no method to implement
- slow due to usage of reflection
- need extensive garbage collection
Parcelable
- Android specific interface
- more coding, need to implement the serialization
- more efficient than Serializable
- less garbage collection with custom code for marshaling and unmarshaling
- fast, heavilvy optimized code
If you want to write good efficient codes, take Parcelable approach.