| | |
| | | } |
| | | |
| | | /** |
| | | * 鑾峰彇澶栭儴瀛樺偍鍗� |
| | | * 获取外部存储 |
| | | * |
| | | * @param context |
| | | * @return |
| | |
| | | } |
| | | /* |
| | | * } else { if (Environment.getStorageState(Environment.) |
| | | * .equals(Environment.MEDIA_MOUNTED)) { // 涓簍rue鐨勮瘽锛屽缃畇d鍗″瓨鍦�} } |
| | | * .equals(Environment.MEDIA_MOUNTED)) { // 为true的话,} } |
| | | */ |
| | | |
| | | return null; |
| | |
| | | public static String getDownLoadPath(Context context) { |
| | | File downloadStorage = getDownloadStorage(context); |
| | | File downloadPath = null; |
| | | // Log.i("help", "鎵嬫満鍐呭瓨"); |
| | | // Log.i("help", "手机内存"); |
| | | if (downloadStorage.equals(Environment.getDataDirectory())) { |
| | | downloadPath = new File(context.getFilesDir(), "video"); |
| | | } else { |
| | |
| | | // String name = context.getPackageName(); |
| | | // int type = getDeaultStorage(context); |
| | | // if (type == STORAGE_MOBILE) { |
| | | // // 涓嬭浇鏂囦欢瀛樻斁鍒版牴鐩綍 Download鏂囦欢澶逛笅 |
| | | // // 下载文件存放到根目录 Download文件夹下 |
| | | // // File f = Environment |
| | | // // .getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); |
| | | // |
| | | // // 涓嬭浇鏂囦欢瀛樻斁鍒癮pp瀹夎鐩綍涓� |
| | | // File f = context.getExternalFilesDir("鏈ㄧ摐缂撳瓨鏂囦欢"); |
| | | // // 下载文件存放到app安裑目录 |
| | | // File f = context.getExternalFilesDir("木瓜缓存文件"); |
| | | // // File f = context.getExternalCacheDir(); |
| | | // if (!f.exists()) |
| | | // f.mkdirs(); |