/** * Creates a singleton DataLogger or returns the already created object. Before writing to a file * first openWriter() must be called. * * @return The singleton object. */ public static DataLogger getInstance() { if (singletonInstance == null) { singletonInstance = new DataLogger(); singletonInstance.mFileName = "ProbeLog_" + new Date().getTime(); singletonInstance.openWriter(); } return singletonInstance; }