Java tutorial
//package com.java2s; import android.content.Context; import java.io.FileOutputStream; import java.io.ObjectOutputStream; public class Main { public static boolean saveObject(Context context, Object data, String filename) { FileOutputStream out; ObjectOutputStream oout; try { out = context.openFileOutput(filename + ".odb", Context.MODE_PRIVATE); oout = new ObjectOutputStream(out); oout.writeObject(data); oout.flush(); out.flush(); oout.close(); out.close(); return true; } catch (Exception e) { e.printStackTrace(); } return false; } }