public static boolean saveBitmapToFile(Bitmap bitmap,String path){
  File file=new File(path);
  FileOutputStream fOut;
  try {
    fOut=new FileOutputStream(file);
    bitmap.compress(Bitmap.CompressFormat.JPEG,100,fOut);
    fOut.flush();
    fOut.close();
    return true;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return false;
}

public static boolean saveBitmapToFile ( Bitmap bitmap , String path ) { File file = new File ( path ) ; FileOutputStream fOut ; try { fOut = new FileOutputStream ( file ) ; bitmap . compress ( Bitmap . CompressFormat . JPEG , 100 , fOut ) ; fOut . flush ( ) ; fOut . close ( ) ; return true ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return false ; }
save bitmap to given file
