Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}