String filename = "myfile";
String string = "Hello world!";
FileOutputStream outputStream;
try {
outputStream = openFileOutput(filename, Context.MODE_PRIVATE);
outputStream.write(string.getBytes());
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}好的,上面的代码在内部存储中创建一个文件,并将一些东西写入其中。我的问题是,在Eclipse中在哪里可以找到和打开这个文件?我希望看到它的内容,并手动编辑它。或者我可能想要包含我自己的文件并阅读它的内容。
发布于 2015-01-12 17:48:48
我的问题是,在Eclipse中在哪里可以找到和打开这个文件?
使用DDMS透视图中的文件管理器,对于模拟器上的默认用户帐户,转到/data/data/your.application.id.goes.here/files,在清单中的package中使用your.application.id.goes.here。
https://stackoverflow.com/questions/27907838
复制相似问题