我正在写一个应用程序,它使用MediaRecorder记录声音。为了得到一个目录,记录文件应保存我这样做:当我使用getExternalStorageDirectory()我得到了错误的目录
String fileName = Environment.getExternalStorageDirectory().getAbsolutePath() + "/record.3gp";
然后:
mRecorder.setOutputFile(fileName);
音频记录良好,我有一个文件保存,但在错误的地方。该文件保存在我的内部存储器中(我正在使用GT-I9300)。这是为什么?如何获得任何设备中任何外部存储的正确路径?提前致谢。
看到这可能是有用的http://stackoverflow.com/questions/5453708/android-how-to-use-environment-getexternalstoragedirectory – keshav