Hello, while studying Android, I have a question, so I posted this question.
I suddenly remembered watching YouTube, where the serialization of objects that I saw once said that data transfer was very bad for performance, so I just watched it again.
I watched this video.
In this video, serialization is not good for performance, so I recommend you to use something else Gson, parallel, shared preference, and so on.
What I'm curious about here is
I'm just using serializable for the app I'm making for practice, but I'm going to use it to practice and study!
android performance
If you want to send and receive objects between activities with Intent, if you can modify the object (class) to implement a parallel interface, you'd better do it this way, and if not, think about another way in the next lane.
Even with a few String data, the mechanism of action that Serializable has can be a significant burden on memory. I don't know how Android Java handles it, but when it's usually declared serializable, Java tries to place the members of that object in consecutive memory spaces. The larger the junk (object), the more problems with memory management in the JVM.
Reference
Serializable is an interface created in Java to allow objects in memory to pass to other systems (Java machines) via network, file-like I/O, except for the description of the actual mechanism of operation. In general, if you simply inherit the serializable interface, the serialization process is handled by the JVM itself, but the conversion cost is quite high.
Parcelable can be considered as a substitute for Serializable when exchanging objects between android Java on Android.
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.