Java tutorial
//package com.java2s; import android.graphics.Bitmap; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class Main { public static void storeImage(Bitmap bitmap, String outPath) throws FileNotFoundException { File file = new File(outPath); if (file.exists()) { file.delete(); } FileOutputStream os = new FileOutputStream(outPath); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, os); } }