I have an ArrayList which contains custom Service objects. I want to write the whole ArrayList to a File and be able to read it afterwards.
I tried Gson for that, but it
I would recommend using serialization for such an operation. You can implement Java's Serializable interface and you are then able to deflate your objects into a .ser file and then inflate them back from that very file to call the methods you need from them.
Here is a nice tutorial regarding Serialization - http://www.tutorialspoint.com/java/java_serialization.htm