Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Java for Android
  • Android Studio
  • Android Kotlin
  • Kotlin
  • Flutter
  • Dart
  • Android Project
  • Android Interview
Open In App
Next Article:
Difference Between Serializable and Parcelable in Android
Next article icon

Difference Between Serializable and Parcelable in Android

Last Updated : 27 Feb, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Android is a mobile operating system developed by Google and it is used by millions of people all over the world. Android is open-source software and is widely popular for its user-friendly interface and flexibility. The Android platform supports two different ways of transferring data between activities, namely serializable and parcelable. Both of these methods are used to store and transfer data across activities, but they have some notable differences.

What is Serializable in Android?

Serializable is a Java interface that enables an object to be serialized, meaning that it can be converted into a byte stream and stored in a file or transmitted over a network. This is a simple method of saving objects to a file or sending them over a network. When an object is serialized, it is converted into a byte stream that is easily readable by the receiving end. The receiving end can then convert the byte stream back into an object. Serialization is a quick and efficient way of transferring data across activities.

What is Parcelable in Android?

Parcelable is an Android-specific interface that enables an object to be passed as a parameter from one activity to another. This is a more efficient method compared to serialization, as it doesn’t require the object to be converted into a byte stream. When an object is passed using parcelable, it is passed directly from one activity to another. Parcelable also has the advantage of being able to pass a large amount of data in a single call, making it more efficient than serialization.

Difference Table

Factor

Serializable 

Parcelable

OverviewSerializable is the standard Java interface for persistence.Parcelable is the Android-specific interface for persistence. 
SerializationObjects are serialized using the Java Serialization API.Objects are serialized using the Android Parcelable API.
Memory UsageSerializable objects are stored in memory and can be retrieved quickly.Parcelable objects are stored in an Android application bundle and require more time to access.
SpeedSerializable is slower than Parcelable.Parcelable is faster than Serializable.
SizeSerializable objects are larger than Parcelable objects.Parcelable objects are smaller than Serializable objects.
ImplementationSerializable objects are implemented by implementing the Serializable interface.Parcelable objects are implemented by extending the Parcelable class.
HierarchySerializable supports class hierarchy.Parcelable does not support class hierarchy.
ReflectionSerializable objects can be accessed using Java's reflection API.Parcelable objects cannot be accessed using Java's reflection API.
Thread SafetySerializable objects are not thread-safeParcelable objects are thread-safe

Next Article
Difference Between Serializable and Parcelable in Android

O

ojasvigupta
Improve
Article Tags :
  • Difference Between
  • Android

Similar Reads

    Android - Difference Between RecyclerView and ListView
    In Android View is a basic building block of UI (User Interface). A view is a small rectangular box that responds to user inputs. RecyclerView and ListView are the two major Views in Android. So in this article, we are going to see the major differences between these two views. RecyclerView Recycler
    3 min read
    Difference Between View and ViewGroup in Android
    In Android Layout is used to describe the user interface for an app or activity, and it stores the UI elements that will be visible to the user. An android app's user interface is made up of a series of View and ViewGroup elements. In most cases, android apps will have one or more operations, each o
    5 min read
    Difference Between GSON and JSON in Android
    JSON stands for JavaScript Object Notation. It is a text format for storing and transporting data. JSON is "self-describing" and easy to understand. It is a lightweight data-interchange format. JSON is used to send data between computers as it is language-independent. Code for reading and generating
    3 min read
    Difference Between Serializable and Externalizable in Java Serialization
    The process of writing the state of an object to a file is called serialization, but strictly speaking, it is the process of converting an object from java supported form into a file-supported form or network-supported form by using fileOutputStream and objectOutputStream classes we can implement se
    6 min read
    Android - Difference Between MATCH_PARENT, FILL_PARENT and WRAP_CONTENT
    Views refer to as a user interface in android. The front end of the application is made by using widgets and views. The prominent language used for the user interface in android is XML. There are different types of Views in the Android Studio such as TextView, ImageView, EditTextView, etc. They all
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences