Android examples for android.content:Context
save file via context
import android.content.Context; import android.content.SharedPreferences; import android.os.Environment; import java.io.*; public class Main{ public static void save(Context context, String fileName, String content) throws IOException { FileOutputStream fileOutputStream = context.openFileOutput( fileName, Context.MODE_WORLD_READABLE); fileOutputStream.write(content.getBytes()); fileOutputStream.close();//from w w w. j a v a 2 s . c o m } }