【发布时间】:2013-04-24 18:13:22
【问题描述】:
我正在写入路径 mnt/sdcard/foldername。我没有收到任何错误并且文件已写入,但是当我浏览手机的内部存储时,我找不到该文件夹。该文件夹将位于何处?我有银河系?
代码在这里:
File sdCard = Environment.getExternalStorageDirectory();
File directory = new File (sdCard.getAbsolutePath() + "/statReporter/");
directory.mkdirs();
Log.d("Tag", directory.toString());
//Path and name of XML file
File file = new File(directory, appendTimeStamp("phoneNum") + ".csv");
FileOutputStream fOut = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fOut);
//Write to CSV File
osw.write(message);
osw.write(',');
//Flush and close OutPutStreamWriter and close FileOutputStream
osw.flush();
osw.close();
fOut.close();
Log.d("File Logger:", "File write successfully!");
在 Windows Computer\Galaxy Nexus\Internal Storage 中找不到它,但所有其他文件夹都会出现。
我使用了一个名为 OI File Managaer 的应用程序,我可以在手机上查看文件夹和文件,但如何通过 Windows 操作系统查看?
【问题讨论】:
-
你是如何浏览手机的?
-
只需在外部 SD 卡文件夹名称中检查即可
-
如果写入 mnt/sdcard/foldername 那么你必须从相同的路径读取..而不是从内部存储..
-
检查我修改后的答案。我记得 Eclipse 也允许您通过 DDMS 透视图浏览文件结构。