title: Detect Android Camera folder
body: <p>I would like to detect the camera folder on every Android device. From what I've read this folder differs from an manufacturer to another and there is no guarantee that there will be even an DCIM folder on the device. </p>
  
  <p>This is the method that I'm using to get the files now:</p>
  
  <pre><code>private static final Set&lt;String&gt; FILTER_FOLDERS = new HashSet&lt;String&gt;(
          Arrays.asList(new String[] { "camera", "100andro", "100media" }));
  
  
  private Set&lt;String&gt; getCameraPictures() {
          final String[] columns = new String[] {
                  MediaStore.Images.ImageColumns._ID,
                  MediaStore.Images.ImageColumns.DATA,
                  MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
                  MediaStore.Images.ImageColumns.DISPLAY_NAME,
                  MediaStore.Images.ImageColumns.DATE_TAKEN,
                  MediaStore.Images.ImageColumns.MIME_TYPE };
          // Order by options - by date &amp; descending
          final String orderBy = MediaStore.Images.ImageColumns.DATE_TAKEN
                  + " DESC";
          // Stores all the images from the gallery in Cursor
          final Cursor cursor = getContentResolver().query(
                  MediaStore.Images.Media.EXTERNAL_CONTENT_URI, // base URI for
                                                                  // the Images
                  columns, // Which columns to return
                  null, // Which rows to return (all rows)
                  null, // Selection arguments (none)
                  orderBy); // Ordering
  
          // Total number of images
          int count = cursor.getCount();
  
          // Create an array to store path to all the images
          String[] picturesPath = new String[count];
  
          if (cursor.moveToFirst()) {
              int dataColumn = cursor
                      .getColumnIndex(MediaStore.Images.Media.DATA);
              int bucketColumn = cursor
                      .getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME);
  
              do {
                  if (FILTER_FOLDERS.contains(cursor.getString(bucketColumn)
                          .toLowerCase(Locale.getDefault()))) {
                      // Store the path of the image
                      picturesPath[cursor.getPosition()] = cursor
                              .getString(dataColumn);
                  }
              } while (cursor.moveToNext());
          }
          // Close the cursor
          if (null != cursor) {
              cursor.close();
          }
          return new HashSet&lt;String&gt;(Arrays.asList(picturesPath));
      }
  </code></pre>
  
  <p>But this is returning images from other places also ... 
  How can I retrieve only the images taken with the camera ?
  If there is no native way to do this, where can I find what are the names for the folders used by each manufacturer (as many as there are) so that I can filter it by BUCKET_DISPLAY_NAME ?</p>
  
  <p>Thank you</p>
  
  <p>LE:</p>
  
  <p>I have updated the method to get the images on device &amp; also filter the folders.</p>