Android中文件存储操作:
Activity的openFileOutput()方法可以用于把数据输出到文件中创建的文件保存在/data/data//files目录实现过程与在java 中保存数据到文件一样
File file = this.getFilesDir();
//返回当前默认的数据存储目录
File file = this.getFilesDir();...
分类:
其他好文 时间:
2016-05-07 08:05:48
阅读次数:
135
1、将字符串写入文件流中。使用的是getFilesDir()。存到手机内存中。 File file = new File(getFilesDir() + "/info.txt"); try { OutputStream out = new FileOutputStream(file); out.wr
分类:
移动开发 时间:
2016-03-12 19:55:29
阅读次数:
261
File filesDir = getFilesDir(); File file = new File(filesDir, "test.txt"); FileReader fr = new FileReader(file); int len ...
分类:
移动开发 时间:
2015-10-21 22:49:03
阅读次数:
174
一、files1. Context.getFilesDir(),该方法返回/data/data/youPackageName/files的File对象。2. Context.openFileInput()与Context.openFileOutput(),只能读取和写入files下的文件,返回的是F...
分类:
移动开发 时间:
2015-09-28 19:00:39
阅读次数:
176
关于Context中:1. getCacheDir()方法用于获取/data/data//cache目录2.getFilesDir()方法用于获取/data/data//files目录3.getExternalFilesDir()方法可以获取到 SDCard/Android/data/你的应用的包名...
分类:
移动开发 时间:
2015-09-16 17:39:21
阅读次数:
210
(1) Activity提供了openFileOutput()方法可以用于把数据输出到文件中;
(2)文件可用来存放大量数据,如文本、图片、音频等。
(3)存储默认位置: /data/data//files/***.***
(4)Activity还提供了getCacheDir()和getFilesDir()方法
1)getCacheDir()方法用于获取/data/data//cache目录
2)getFilesDir()方法用于获取/data/data//file...
分类:
移动开发 时间:
2015-08-27 18:52:27
阅读次数:
171
在需要存储的时候,路径的问题是初学者比较迷惑的,下面是对于getCacheDir()、getFilesDir()、getExternalFilesDir()、getExternalCacheDir()的一些经验之谈,仅供参考思密达...首选,需要明确的是 各自代表的路径具体位置在哪里getCache...
分类:
其他好文 时间:
2015-08-09 15:24:23
阅读次数:
114
getDatabasePath()
getCacheDir()
getFilesDir()
openFileInput()
openFileOutput()
fileList()
deleteFile()
getDir()
getCodeCacheDir()
getPackageCodePath()
getPackageResourcePath()
getExternalFilesDir(String type)
getExternalFilesDirs(String type)
getExterna...
分类:
移动开发 时间:
2015-07-29 21:23:24
阅读次数:
208
File? getFilesDir() -------------获取/data/data/<packagename>/files 目录 FileInputStream openFileInput(String name) ------------打开现有文件进行读取 FileOutputStream openFileOutput(String name,in...
分类:
其他好文 时间:
2015-07-13 18:59:09
阅读次数:
107
利用XmlSerializer和XmlPullParser对xml文件进行读写操作下面是XmlSerializer在手机内存中写入xml文件的内容:public void writeXML(){ File file =new File(this.getFilesDir(), "test...
分类:
移动开发 时间:
2015-06-29 16:22:35
阅读次数:
132