标签:ar os 文件 on div art cti ef as
getCacheDir()方法用于获取/data/data//cache目录
getFilesDir()方法用于获取/data/data//files目录
//==================================================
将文件写入SD卡内:
获取SDCard的状态:
Environment.getExtemalStorageState()
Environment.MEDIA_MOUNTED手机装有SDCard,并且可以进行读写
获取SDCard的目录:Environment.getExtemalStorageDirectory()
//=============================================
File saveFile=new File("/sdcard/zhzhg.txt");
或:File sdCardDir=new File("/sdcard");//获取SD卡目录
File saveFile = new File(sdCardDir,"zhzhg.txt");
FileOutputStream outStream = new FileOutputStream(saveFile);
outStream.write("文件的读写".getBytes());
outStream.close();
getCacheDir()和getFilesDir()方法区别.
标签:ar os 文件 on div art cti ef as
原文地址:http://www.cnblogs.com/zhujiabin/p/4119502.html