Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the Android camera folder before API 8

In Android 2.2 and newer, you can get the default camera folder using Environment.DIRECTORY_DCIM, but is there a way to get it in Android 2.1 and earlier?

like image 272
Michell Bak Avatar asked Dec 30 '25 18:12

Michell Bak


1 Answers

No, sorry. You can try:

new File(Environment.getExternalStorageDirectory(), "DCIM")

and see how stable that is.

Bear in mind that neither my technique nor Environment.DIRECTORY_DCIM will necessarily be honored by all devices. When the Android documentation refers to Environment.DIRECTORY_DCIM as the "traditional location for pictures and videos when mounting the device as a camera" (emphasis mine), a warning bell should be going off in your mind. Just because it is "traditional" does not mean any device manufacturer will necessarily use it.

like image 69
CommonsWare Avatar answered Jan 02 '26 07:01

CommonsWare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!