一.android项目的文件结构
adb shell命令下获取android系统文件的结构如下:
常用文件夹
data 保存项目文件 如:com.zhihu.android
内层文件
cache
storage
sdcard
二.各个文件的保存的文件
文件保存路径:目前先放在sdcard下 android获取路径的方法:
Environment.getExternalStorageDirectory().getPath()public static void saveBitMapToSDK(Bitmap bm) throws IOException{
String path = Environment.getExternalStorageDirectory().getPath();
Log.d(TAG, “saveBitMapToSDK: ” + path);
File dirFile = new File(path);
if(!dirFile.exists()){
dirFile.mkdir();
}
String filePath = path+”/”+getTimeStamp()+”.jpeg”;
Log.d(TAG, “saveBitMapToSDK: “+filePath);
File myCaptureFile = new File(filePath);
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(myCaptureFile));
bm.compress(Bitmap.CompressFormat.JPEG, 80, bos);
bos.flush();
bos.close();
}