Java tutorial
//package com.java2s; import android.graphics.Bitmap; import java.io.File; import java.io.FileOutputStream; public class Main { public static void saveBitmap(Bitmap bitmap, File bitmapFile) { try { if (bitmap != null && bitmap.getWidth() > 0 && bitmap.getHeight() > 0) { FileOutputStream out = new FileOutputStream(bitmapFile); bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); } } catch (Exception e) { e.printStackTrace(); } } }