I have a method in my application which retrieves the last saved image in my DCIM/Camera
folder and copies it to another location on the SD card. I've just tested it on another phone and found that it defaults saving to DCIM/100MEDIA
. How am I able to get this path?
I ended up writing some code which looped through all the folders in the DCIM folder and retrieved the path of the lastModified() folder.
Looks like it is manufacturer dependent. In addition to using methods described in book, it seems also allowing the user to choose/override the default you "discover" would be an important option.
From Pro Android 3: p 579
Unfortunately, there is not a method call to tell you which directory might be used underneath the
DCIM
directory for Camera pictures. There are a couple of methods though to tell you where the top of the SD card is. The first isEnvironment.getExternalStorageDirectory()
and it returns aFile
object for the top-level directory for the SD card.
See the following Google books link for full page text: http://books.google.com/books?id=RuN0jb4YASwC&pg=PA579&lpg=PA579
Do all Android phones with a built-in camera use a folder called "DCIM" to store captured images?
http://androidforums.com/android-lounge/5930-definitive-androids-folder-structure.html#post239353
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With