android 在本地建立文件夹,并将图片和音频保存在文件夹下,
<span style="font-size:18px;"> public void newFile() {
String fileName = "niannian";
String albumFileName = "picture";
File file = new File(Environment.getExternalStorageDirectory(),
fileName);
if (!file.exists()) {
file.mkdirs();
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
path = file.getPath();
File albumFile = new File(path, albumFileName);
if (!albumFile.exists()) {
albumFile.mkdir();
try {
albumFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
albumPath = albumFile.getAbsolutePath();
}</span>
首先是在本地创建一个niannian 文件夹,然后在文件夹下创建一个picture文件夹,首先