Java tutorial
//package com.java2s; import android.graphics.Bitmap; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void saveToFile(Bitmap bmp, String filePath) throws IOException { File file = new File(filePath); if (!file.exists()) { file.createNewFile(); } FileOutputStream fout = new FileOutputStream(file); bmp.compress(Bitmap.CompressFormat.JPEG, 100, fout); fout.close(); } }