Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void saveFile(Context context, String name, String text) throws IOException { FileOutputStream fos = context.openFileOutput(name, Context.MODE_PRIVATE); fos.write(text.getBytes()); fos.close(); } }