Android examples for android.hardware:Photo
find Photo From SDCard
import java.io.File; public class Main { public static boolean findPhotoFromSDCard(String path, String photoName) { boolean flag = false; if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) { File dir = new File(path); if (dir.exists()) { File folders = new File(path); File photoFile[] = folders.listFiles(); for (int i = 0; i < photoFile.length; i++) { String fileName = photoFile[i].getName().split("\\.")[0]; if (fileName.equals(photoName)) { flag = true;/* w w w . ja v a2 s .c o m*/ } } } else { flag = false; } } else { flag = false; } return flag; } }