Java tutorial
//package com.java2s; import android.content.Context; import android.net.Uri; import android.os.Environment; import android.util.Pair; import java.io.File; public class Main { public static Pair<Boolean, Uri> isTrackExist(Context context, String artist, String track) { File file = new File(context.getExternalFilesDir(Environment.DIRECTORY_MUSIC), artist + " - " + track + ".mp3"); return new Pair<>(file.exists(), Uri.fromFile(file)); } }