I know that this question has been asked several times, and I went through many of these questions ... almost all of these questions make you use a great interface for your class. However, in a few questions, I came across a quote:
"NOTE: viewing Parcelable may ask why Android doesn’t use the built-in Java serialization engine? It turns out that the Android team concluded that serialization in Java is too slow to satisfy the Interrocess-communication Androids requirements. Thus, the team built a Parcelable solution. For the approach Parcelable requires that you explicitly serialize members of your class, but in the end, you get much faster serialization of your objects.Also understand that Android provides two mechanisms that allow you to transfer data to another The first is to transfer the beam to the action using the intent, and the second is to transfer the Opportunity for service.The two mechanisms are not interchangeable and should not be embarrassed. That is, Parcelable is not intended to convey activity. If you want to start an activity and give him some data, use the kit. Parcelable is intended to be used only as part of the AIDL definition. "
This quote can also be found in the Pro Android 2 book.
Now, seeing that all actions in one application are performed in the same process ( Each activity in Android is a process or one application is a single process ), unless otherwise specified in the manifest, the connection within the action of the same applications is not interprocess communication per se. Is it really faster to use the parcelable class, or is it enough to pass the attributes of an object through a package through an intent?
Shedding light on this aspect will be greatly appreciated. Greetings!
source
share