title: List out all images from SD card
body: <p>Hi I am developing android Gallery app . I am fetching the images from a folder in sd card and displaying it on a grid view as below</p>
  <pre><code>public static ArrayList&lt;String&gt; getFilePaths(){
      ArrayList&lt;String&gt; filePaths = new ArrayList&lt;String&gt;();
      File directory = new File(android.os.Environment.getExternalStorageDirectory() 
               + File.separator + AppConstant.PHOTO_ALBUM);
  
      // check for directory
      if (directory.isDirectory()){
          // getting list of file paths
          File[] listFiles = directory.listFiles();
  
          // Check for count
          if (listFiles.length &gt; 0) {
              for (int i = 0; i &lt; listFiles.length; i++){
  
                  String filePath = listFiles[i].getAbsolutePath();
  
                  if (IsSupportedFile(filePath)){
                      // Add image path to array list
                      filePaths.add(filePath);
                  }
              }
          }else{
              // image directory is empty
              Toast.makeText(_context,
                      AppConstant.PHOTO_ALBUM
                      + &quot; is empty. Please load some images in it !&quot;,
                      Toast.LENGTH_LONG).show();
          }
  
      } 
      return filePaths;
  }
  
  //fetching all image paths
   imagePaths = utils.getFilePaths();
   adapter = new GridViewImageAdapter(GridViewActivity.this, imagePaths, columnWidth);
   // setting grid view adapter
   gridView.setAdapter(adapter);
  </code></pre>
  <p><strong>I want to display all the images from SD card</strong> not only in a specified folder. I am not sure How to do it.</p>
  <p>Please Help. Thanks!</p>