/**
* 判断是否存在SD卡
*
* @return
*/
public static final boolean hasSDCard() {
return Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
}
public static final String getCachePath(Context context) {
if (hasSDCard()) {
return Environment.getExternalStorageDirectory().toString() + File.separator + CACHE_ROOT_DIRECTORY;
} else {
return context.getCacheDir() + File.separator + CACHE_ROOT_DIRECTORY;
}
}