Java tutorial
//package com.java2s; import java.io.BufferedOutputStream; import java.io.FileNotFoundException; import android.content.Context; import android.graphics.Bitmap; public class Main { public static void writeTofiles(Context context, Bitmap bitmap, String filename) { BufferedOutputStream outputStream = null; try { outputStream = new BufferedOutputStream(context.openFileOutput(filename, Context.MODE_PRIVATE)); bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream); } catch (FileNotFoundException e) { e.printStackTrace(); } } }