In an android app I need to persist some data to a file that is in an ArrayList of objects of type A. The objects of type A in ArrayList consist of standard primitive objects, except each A object also contains an ArrayList of objects of type B.
The B objects are also composed of primitive data types. Neither class A nor B has any particular code for implementing Serializable at this point.
My question is how should I go about writing this data to a file. Do I need to add specific support to serialize these objects? I suspect not since they only contain primitive data types, but OTOH I suspect I need to since ArrayList is not a primitive type itself.
Guidance is much appreciated. I want to do the simplest thing possible. I know I could write my own JSONSerializer code that manually serializes each field in class A, and invokes JSON serializer code from class B to serialize the ArrayList items, and stuff it all in a file. I also am not interested in running this all through SQLLite.
WHile I have found many posts on serializing arraylists I have found none for nested ArrayLists. Thanks in advance for the assist.