标签:des android style blog color java os io
在调用前需要判断是否有写入权限
Environment类提供了比较丰富的方法
static File |
获得android data的目录。 |
static File |
获得下载缓存目录。 |
static File |
或者外部存储媒体目录。 |
static File |
getExternalStoragePublicDirectory(String type) Get a top-level public external storage directory for placing files of a particular type. |
static String |
获得当前外部储存媒体的状态。 |
static File |
获得android的跟目录。 |
public void saveSDCard(String filename, String filecontent)throws Exception { File file = new File(Environment.getExternalStorageDirectory(),filename); FileOutputStream outStream = new FileOutputStream(file); outStream.write(filecontent.getBytes()); outStream.close(); }
android 往sd卡中写入文件,布布扣,bubuko.com
标签:des android style blog color java os io
原文地址:http://www.cnblogs.com/sxmny/p/3923723.html