Here you can find the source of saveBitmap(Bitmap image)
public static String saveBitmap(Bitmap image)
//package com.java2s; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import android.content.Context; import android.graphics.Bitmap; import android.util.Log; public class Main { static Context cntxt; public static String saveBitmap(Bitmap image) { String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmm") .format(new Date()); String mImageName = "IP_" + timeStamp + ".jpg"; try {/*w w w . j a v a 2 s .c om*/ FileOutputStream fos = cntxt.openFileOutput(mImageName, Context.MODE_PRIVATE); image.compress(Bitmap.CompressFormat.PNG, 90, fos); fos.close(); } catch (FileNotFoundException e) { Log.d("image", "File not found: " + e.getMessage()); } catch (IOException e) { Log.d("image", "Error accessing file: " + e.getMessage()); } return mImageName; } }