code: public static boolean writeToFile(Bitmap bmp, String fileName) {
          if (bmp == null || StringUtils.isNullOrEmpty(fileName))
              return false;
          FileOutputStream fos = null;
          try {
              fos = new FileOutputStream(fileName);
              bmp.compress(CompressFormat.PNG, 100, fos);
              fos.flush();
              fos.close();
          } catch (Exception e) {
              return false;
          } finally {
              if (fos != null) {
                  try {
                      fos.close();
                  } catch (IOException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
              }
          }
          return true;
      }
docs: write bitmap to file.
  
  @param bmp
  @param fileName
  @return whether the file has been created success.