The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.
Parcelable is a marker interface, reminiscent of
Serializable, that shows up in many places in the Android SDK.
Parcelable objects can be put into
Intent extras or
Bundle objects, for example. Making your own custom classes
Parcelable greatly increases their flexibility.
At the same time,
Parcelable is something that can be overused.
In most Android apps, few if any custom classes really need to have
In this chapter, we will review how to modify classes to implement
Parcelable and what the limitations are on using
Understanding this chapter requires that you have read the core chapters of this book.
Parcelable object is one that can be placed into a
Parcel is the primary vehicle for passing data between processes
in Android’s inter-process communication (IPC) framework.
IPC abounds in Android, even in places where you may not expect it.
Every time you call
startActivity(), for example, IPC occurs, even
if the activity that calls
startActivity() and the activity to be
started are in the same process. A core OS process is the one that
is responsible for identifying the activity to be started and routing
control to it, so
startActivity() performs IPC from the original
activity’s process to a core OS process. The core OS process then
eventually performs IPC to the target process for the activity to be
If you see an
Intent or a
Bundle in the Android SDK, odds are
that those objects are involved in IPC. That is not always the
LocalBroadcastManager, for example, uses
purely in-process — but it is a reasonable rule of thumb. Hence,
there is keen interest in being able to implement
specific classes, either to pass to other components via
extras, or to become part of the saved instance state
Parcelable objects are also important for use with
remote services via the binding pattern.
The preview of this section is en route to Mars.
The preview of this section left for Hollywood to appear in a reality TV show.
The preview of this section is presently indisposed.