Java tutorial
//package com.java2s; import java.io.FileOutputStream; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; public class Main { public static String saveToFile(String filename, Bitmap bmp) { try { FileOutputStream out = new FileOutputStream(filename); bmp.compress(CompressFormat.PNG, 100, out); out.flush(); out.close(); return filename; } catch (Exception e) { e.printStackTrace(); return ""; } } }