Reading Images only from Camera

Posted by Ankit on Stack Overflow See other posts from Stack Overflow or by Ankit
Published on 2010-05-26T13:16:38Z Indexed on 2010/05/26 13:21 UTC
Read the original article Hit count: 310

Filed under:
|

I wanted to read images only from the Camera folder of the device. Since the folder might be different for different devices, how can I write a simple application for it). So far I have written the following code, which does read from Camera folder, but it also reads from other places on sdcard as well.

Cursor childCursor =
managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
MediaStore.Images.ImageColumns._ID, null);

do
{
       ImageView image = new ImageView();

image.setImageURI(Uri.withAppendedPath(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
""+

childCursor.getString( childCursor.getColumnIndex( MediaStore.Images.ImageColumns._ID )));

       <some other code>
} while (childCursor.moveToNext());

How can I create a generic app and filter on Camera Images before displaying. Any help is appreciated.

© Stack Overflow or respective owner

Related posts about images

Related posts about android-sdk