I know a library called libaums and had implemented it, but I don't know how to open Images and Videos using their library.
Asked
Active
Viewed 590 times
1 Answers
0
According to https://github.com/magnusja/libaums, you can actually read a file from the storage using this:
// read from a file
InputStream is = new UsbFileInputStream(file);
byte[] buffer = new byte[currentFs.getChunkSize()];
is.read(buffer);
Then your buffer
contains the image data, so you can convert it to e.g. a Bitmap, like this:
Bitmap bmp = BitmapFactory.decodeByteArray(buffer , 0, buffer .length);
After that you can set it to an ImageView
or whatever to show it to your user.
To be short, find your File
and implement this logic.

gi097
- 7,313
- 3
- 27
- 49
-
It worked thanks a lot. Now I'm done with Images, What about videos ? – Vivek Patel Oct 28 '17 at 10:06
-
You can read the docs. If it helped for you, please mark this as an answer :) – gi097 Oct 28 '17 at 10:09
-
Done. Thanks for your help. – Vivek Patel Oct 28 '17 at 10:16