Android examples for java.io:FileWriter
save Text File with FileWriter
import java.io.File; import java.io.FileWriter; public class Main { public static boolean saveTextFile(File file, String text) { try {// ww w .j a v a 2 s. co m FileWriter writer = new FileWriter(file); writer.append(text); writer.flush(); writer.close(); return true; } catch (Exception e) { e.printStackTrace(); return false; } } }