我有一个android应用程序,我需要在文本文件中写入一些字符串值。我有编码写在一个文本文件。但我不知道我要创造我的文字file.Please参考我下面的代码,在哪个路径我需要把文本文件写在android
FileOutputStream fOut = null;
OutputStreamWriter osw = null;
try{
fOut = openFileOutput(“public.dat”, Context.MODE_PRIVATE);
osw = new OutputStreamWriter(fOut);
osw.write(“TEXT”);
osw.close();
fOut.close();
}catch(Exception e){
e.printStackTrace(System.err);
}
请通知我哪条路我应该创建文本文件。
http://www.anddev.org/working_with_files-t115.html – RobinHood 2013-04-09 06:47:30
你需要告诉我们你的文本文件应该是什么样的,然后我们才能告诉你在哪里存储它。 – 2013-04-09 06:48:36
@类:我打算在文本文件中写入一些数据。如果我把我的文本文件放在资产文件夹中,我认为它不可能写入它,那我需要在哪个文件夹中放置我的文本文件。 – shivcena 2013-04-09 06:52:08