0

I pass information around in my app with ArrayList and Hashmap a lot, but for persistent storage of complex objects, can I use some kind of "Parcelable" or something to store generic object types - that I can restore and stuff - without creating a database and doing the db management functions?

just curious thats all

Thanks!

CQM
  • 42,592
  • 75
  • 224
  • 366
  • 1
    depending on what types of objects are in your ArrayList it is possible that they could be serializable, which would allow you to store them as text into a file. If that is not an option you could likely use some other text based format to store them XML, CSV, etc.. Without knowing more about what you are storing though I wouldn't be able to get more specific. – FoamyGuy Oct 24 '11 at 23:58

1 Answers1

1

From the documentation :

Parcel is not a general-purpose serialization mechanism. This class (and the corresponding Parcelable API for placing arbitrary objects into a Parcel) is designed as a high-performance IPC transport. As such, it is not appropriate to place any Parcel data in to persistent storage

Like Tim said, make your object Serializable, so that it can be flattened.

Reno
  • 33,594
  • 11
  • 89
  • 102