using this code
new File(\"/mnt/sdcard/folder\").listFiles().length
returns a sum of folders and files in a particular directory without ca
You have to go though all the folder recursively and find out the files
int mCount; getTotalFiles(File dir) { File[] files = dir.listFiles(); for (File file : files) { if (file.isDirectory()) { getTotalFiles(file); } else { mCount++; } } }