Get path to gallery folder in Android

I know how to programmatically get a gallery image (one by one).

Now that the gallery is organized in a folder

Is there any way to select and get the path to the folder as a gallery ...

alt text

+6
android android-emulator image-gallery gallery
source share
3 answers

With this method, you can get the path to the Gallery your device:

 private static String getGalleryPath() { return photoDir = Environment.getExternalStorageDirectory() + "/" + Environment.DIRECTORY_DCIM + "/"; } 
+13
source share

You can get the path here , but MediaScanner will find every folder on the sdcard with photos.

 final String path = android.os.Environment.DIRECTORY_DCIM; 
+11
source share
 String getGalleryPath() { File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); if (!folder.exists()) { folder.mkdir(); } return folder.getAbsolutePath(); } 
+1
source share

All Articles