0

What are the possibilities in Android, when I intend to use serialization/deserialization with data? Which one serialization/deserialization solution is the best for distant serialization/deserialization (e.g. on server)?

Waypoint
  • 17,283
  • 39
  • 116
  • 170

1 Answers1

1

You can use standard Java serialization (implement Serializable interface) or serialize your data in JSON/XML form and save in files in device memory or external storage (SD card). Also you can use SQLite databases.

Parcelable is not intented to use for data storage. Read this answer.

References: http://developer.android.com/guide/topics/data/data-storage.html

Community
  • 1
  • 1
Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
  • Thanks Sergey, and do you know which is the best for internal serialization (data from one class to another) and for distant serialization (XML, JSON or any custom)? – Waypoint Sep 07 '11 at 06:59
  • 2
    For internal usage `Serializable` is enough in simple cases. If you'll have problems with speed of serialization, then you need to implement custom serialization (link in answer). JSON/XML serialization is slower than standard, but it is optimal solution for sending data over the network (particularly JSON; it is smaller in size). – Sergey Glotov Sep 07 '11 at 07:09