Android 中存储路径

android 4.0 上代码打印 log 如下所示:

String SDPATH = Environment.getExternalSdDirectory() + "/";

String PHONEPATH = Environment.getExternalStorageDirectory() + "/";

通过 Log 输出为 

SDPATH 是/mnt/sdcard/external_sd  

PHONEPATH 为 /mnt/sdcard


建立文件夹:
File dir = new File(SDPATH + dirName);
dir.mkdir();


建立文件:
File dir = new File(PHONEPATH + dirName);
dir.mkdir();

 

android 4.1 上显示

 

String SDPATH = Environment.getExternalSdDirectory() + "/";

String SDPATH = Environment.getExternalStorageDirectory() + "/";

String PHONEPATH = Environment.getInternalStorageDirectory() + "/";

 

通过 Log 输出为 

SDPATH 是 /storage/sdcard0/external_sd  

PHONEPATH 为 /storage/sdcard0

 

 

更详细的内容见:http://blog.csdn.net/lganggang131/article/details/6308365

你可能感兴趣的:(Android 中存储路径)