Java tutorial
//package com.java2s; import android.os.Environment; import java.io.*; public class Main { static public String checkFile(String fileName, String dir) { File dictionaryRoot = new File(Environment.getExternalStorageDirectory(), dir); File dictionaryFile = new File(dictionaryRoot, fileName.substring(0, 1)); File filePath = new File(dictionaryFile, fileName + ".mp3"); if (filePath.exists()) { return filePath.getAbsolutePath(); } return null; } }