package com.magatino.app; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import android.os.Environment; import android.net.Uri; import android.provider.MediaStore; import android.provider.MediaStore.Images; import android.graphics.Bitmap; import android.content.Context; public class FileStream { Context context; public FileStream() { } public void save(Bitmap bitmap) { OutputStream outputStream = null; try { File dest = new File("storage/emulated/0/MagatinoPaint"); if (!dest.exists()) { dest.mkdir(); } File file = new File(dest, "MagatinoPaint" + System.currentTimeMillis() + ".png"); outputStream = new FileOutputStream(file); bitmap.compress(Bitmap.CompressFormat.PNG, 0, outputStream); outputStream.flush(); outputStream.close(); } catch (Exception e) {} } }