Question: I´m writing an application that relies on Ajax requests to retrieve data from a dataBase, the required info is delivered in a Json set of objects, this means that even for the empty fields of the dataBase a pair of propriety/value is generated:

```
[{"field1":"value1","field2":"value2","field3":""},{"field1":"","field2":"","field3":""}]

```

How can I Select only not empty fields from the dataBase via SQL avoiding generating and sending unnecessary data?

Answer: 
Use [getExternalStorageDirectory ()](http://developer.android.com/reference/android/os/Environment.html#getExternalStorageDirectory%28%29) to get the SD card path. (Do not hardcode it)

Loop through each subfolder, and check files names with your desired extension. Use String [endswith()](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#endsWith%28java.lang.String%29) method to check if file name ends with the extension.

[Here's a sample code](http://www.mkyong.com/java/how-to-find-files-with-certain-extension-only/) that might help you.
You can use this code:  

here is the [link](http://programondaspot.blogspot.com/2015/07/display-more-than-one-extension-files.html).

```
/**
  * Class to filter files which are having .mp3 extension
  * */
//you can choose the filter for me i put .mp3
class FileExtensionFilter implements FilenameFilter {
    public boolean accept(File dir, String name) {
        return (name.endsWith(".pdf" ) || name.endsWith(".docs" )) || name.endsWith(".3gp" ) ;
    }
}

```