Hello:

I have an app that uses this standard code to get a list of pictures
stored on the phone:
(It seems to only works when the device in question utilizes /DCIM/
camera) --Many use different folders for default picture storage.


--My question: What might be the best way to detect what the default
camera storage directory is:
(I considered getting a directory list and having the code iterate
through what it finds.)
Is there a way to retrieve it exactly?


public static final String CAMERA_IMAGE_BUCKET_NAME =
        Environment.getExternalStorageDirectory().toString()
        + "/DCIM/Camera";

//BEGIN CODE
final String[] projection = { MediaStore.Images.Media.DATA };
                    final String selection = MediaStore.Images.Media.BUCKET_ID 
+ "
= ?";
                    final String[] selectionArgs = { CAMERA_IMAGE_BUCKET_ID };
                    final Cursor cursor =
context.getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI,
                            projection,
                            selection,
                            selectionArgs,
                            null);
                    ArrayList<String> result = new
ArrayList<String>(cursor.getCount());
                    if (cursor.moveToFirst()) {
                        final int dataColumn =
cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
                        do {
                            final String data = cursor.getString(dataColumn);
                            result.add(data);
                        } while (cursor.moveToNext());
                    }

                    cursor.close();
//END CODE


Thanks for any help,
Josh Beck

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to