Android 如何从内部存储器获取完整路径的Mp3歌曲?

Android 如何从内部存储器获取完整路径的Mp3歌曲?,android,Android,我想实现一个简单的媒体播放器。如何从android的内部存储中检索Mp3歌曲的完整路径。如果您在搜索时遇到任何问题,请先搜索。尽你的努力你会发现。。。 这里有一个链接,请尝试检查文件是否存在 public static String rootPath = Environment.getExternalStorageDirectory() + "/YourDirectory/"; File file = new File(Environment.getExternalStor

我想实现一个简单的媒体播放器。如何从android的内部存储中检索Mp3歌曲的完整路径。

如果您在搜索时遇到任何问题,请先搜索。尽你的努力你会发现。。。
这里有一个链接,请尝试检查文件是否存在

  public static String rootPath = Environment.getExternalStorageDirectory() + "/YourDirectory/";       

 File file = new File(Environment.getExternalStorageDirectory()
            + "/YourDirectoryFolder/Audio/" + NmaeofFile + "/");
    if (!file.exists())
        return false;
    else{
        //Do your work here
         }
然后简单地启动媒体播放器

player.setDataSource(rootPath);//rootpath is the path of your file
            player.prepare();
            player.start();

你们方面有什么努力吗?@Shashank Verma我想从设备内部存储器获取文件路径,而不是从SD卡获取。
player.setDataSource(rootPath);//rootpath is the path of your file
            player.prepare();
            player.start();