android 怎么修改数据库
1个回答
2016-04-22 · 百度知道合伙人官方认证企业
兄弟连教育
兄弟连教育成立于2006年,11年来专注IT职业教育,是国内专业的IT技术培训学校。2016年成功挂牌新三板(股票代码:839467)市值过亿。开设专注程序员培训专注php、Java、UI、云计算、Python、HTML5、
向TA提问
关注
展开全部
These files will be ones that get deleted first when the device runs low on storage. There is no guarantee when these files will be deleted.
但是,最好不要依赖系统来管理,应该自己设定一个最大容量,当超出这个值时自己删除。
Context.getFilesDir(),Context.openFileOutput(String, int),Context.getFileStreamPath(String),Context.getDir(String, int)
/data/data/files
Android支持在SD卡上的应用私有目录,在Froyo版本后,通过getExternalFilesDir()可以获得具体路径。该路径依赖与应用的包名,如果你包为hello.file那么SD开上的应用私有目录为\mnt\sdcard\Android\data\hello.file\files\.
在使用SD卡目录时,需注意SD卡是否挂载,可通过Environment.getExternalStorageState()方法进行判断,如果返回值为Envirnment.MEDIA_MOUNTED表示SD卡处于挂载状态,可以放心使用。
getExternalCacheDir()和getCacheDir()比较
共同点:
files will be deleted when the application is uninstalled
不同点:
1、The platform does not monitor the space available in external storage, and thus will not automatically delete these files. Note that you should be managing the maximum space you will use for these anyway, just like with getCacheDir().
2、External files are not always available: they will disappear if the user mounts the external storage on a computer or removes it. See the APIs on Environment for information in the storage state.
3、There is no security enforced with these files. All applications can read and write files placed here.
但是,最好不要依赖系统来管理,应该自己设定一个最大容量,当超出这个值时自己删除。
Context.getFilesDir(),Context.openFileOutput(String, int),Context.getFileStreamPath(String),Context.getDir(String, int)
/data/data/files
Android支持在SD卡上的应用私有目录,在Froyo版本后,通过getExternalFilesDir()可以获得具体路径。该路径依赖与应用的包名,如果你包为hello.file那么SD开上的应用私有目录为\mnt\sdcard\Android\data\hello.file\files\.
在使用SD卡目录时,需注意SD卡是否挂载,可通过Environment.getExternalStorageState()方法进行判断,如果返回值为Envirnment.MEDIA_MOUNTED表示SD卡处于挂载状态,可以放心使用。
getExternalCacheDir()和getCacheDir()比较
共同点:
files will be deleted when the application is uninstalled
不同点:
1、The platform does not monitor the space available in external storage, and thus will not automatically delete these files. Note that you should be managing the maximum space you will use for these anyway, just like with getCacheDir().
2、External files are not always available: they will disappear if the user mounts the external storage on a computer or removes it. See the APIs on Environment for information in the storage state.
3、There is no security enforced with these files. All applications can read and write files placed here.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询