Using java serialization instead of JM3 serialization system

Hello guys,

I want to create some save files tha include the username and a score number for each level. I searched for some jm3 solutions but I think that the ones that I found don’t work for me because I want to serialize some lists. As far as I know there are no lists (similar to arrayList for examle) that implement Savable interface so I thought that the easiest solution is to follow the traditional java serialization approach.

The two questions that I have in my mind are: 1) is there a better way? and 2) are there any possible issues that may occure with java serialization? (for example if I run the project on a different platform)

Well, you are right that binary exporter can’t take an ArrayList directly but if the object being saved has a list field then it can write it out:
http://hub.jmonkeyengine.org/javadoc/com/jme3/export/OutputCapsule.html#writeSavableArrayList(java.util.ArrayList,%20java.lang.String,%20java.util.ArrayList)

a! That’s interesting. I ll try this.