1

I've came to Android from Java.
I used there, with successes, Serialization mechanizm to keep data in file (mainly to avoid of using additional software like MySQL DB). Mark-up of input-output operations of serialization was easily acceptable on PC (in my particular case it took two - three seconds).
But in Android, serialization of the same bunch of data takes much more time (especially under eclipse emulator which is terribly slow - yes i know there is Genymotion).
Are there any alternatives of ser/deser between file and aplication?
I've heard about Parcelable (but AFAIK this should be use rather to transport data between applications).
Maybe is there something else? Code amount needed to implement and difficulty has no matter. I need speed.

rainbow
  • 1,161
  • 3
  • 14
  • 29

1 Answers1

1

The alternative to serialization is custom serialization :) You can use JSON (with the GSON library), XML with XMLSerializer, etc. You can also use some form ORM (manual or with ORMLite, etc.) to store data in a database, as has been suggested. What you should use depends on what kind of data and how large you are trying to serialize. BTW, Parcelable is used for IPC, it's not meant for persistence.

Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84