0
String fileName;

private void writeFile(Bitmap bmp) {
FileOutputStream out = null;
try {
       out = new FileOutputStream(name + ".jpeg");
       bmp.compress(Bitmap.CompressFormat.JPEG, 90, out);
} catch (Exception e) {
    e.printStackTrace();
} finally {
       try{
           out.close();
       } catch(Throwable ignore) {}
}
}
private void readFile() {

}

Now I need to read the file. Just please help write the "readFile()" method fully depending on my code. Thank you in advance.

  • possible duplicate of [Reading an image file into bitmap from sdcard?](http://stackoverflow.com/questions/8710515/reading-an-image-file-into-bitmap-from-sdcard) – Apoorv Jun 30 '14 at 07:06
  • I don't want to read from sdcard –  Jun 30 '14 at 07:08
  • Do you need to do that with muliple images? maybe you can store them on SQLite DB – yossico Jun 30 '14 at 07:11

1 Answers1

0

Try with following

File f=new File(path, name + ".jpeg");
Bitmap b = BitmapFactory.decodeStream(new FileInputStream(f));

Have a look on the Saving and Reading Bitmaps/Images from Internal memory in Android

Community
  • 1
  • 1
Sunil Kumar Sahoo
  • 53,011
  • 55
  • 178
  • 243
  • Depending on my code should I do so? File f = new File( ,fileName + ".jpeg");? and in place of path what should I write? –  Jun 30 '14 at 07:15