Here you can find the source of writeOneLine(String filename, String value)
public static boolean writeOneLine(String filename, String value)
//package com.java2s; import android.util.Log; import java.io.FileWriter; import java.io.IOException; public class Main { private static final String TAG = Thread.currentThread() .getStackTrace()[1].getClassName(); public static boolean writeOneLine(String filename, String value) { FileWriter fileWriter = null; try {/*from w ww. ja v a2 s . c om*/ fileWriter = new FileWriter(filename); fileWriter.write(value); } catch (IOException e) { String Error = "Error writing { " + value + " } to file: " + filename; Log.e(TAG, Error, e); return false; } finally { if (fileWriter != null) { try { fileWriter.close(); } catch (IOException ignored) { // failed to close writer } } } return true; } }