DownloadInstaller icon indicating copy to clipboard operation
DownloadInstaller copied to clipboard

请问怎么修改下载路径

Open LinMingkui opened this issue 4 years ago • 4 comments

作者你好,请问怎么修改下载路径

LinMingkui avatar Jul 06 '20 09:07 LinMingkui

现在是指定下载路径: storagePrefix = Environment.getExternalStorageDirectory().getPath() + "/"; storageApkPath = storagePrefix + AppUtils.getAppName(mContext) + downloadApkUrlMd5 + ".apk";

你的项目需要自定义下载路径吗?强需求的话我下个版本改一下

AnyLifeZLB avatar Jul 06 '20 09:07 AnyLifeZLB

现在是指定下载路径: storagePrefix = Environment.getExternalStorageDirectory().getPath() + "/"; storageApkPath = storagePrefix + AppUtils.getAppName(mContext) + downloadApkUrlMd5 + ".apk";

你的项目需要自定义下载路径吗?强需求的话我下个版本改一下

建议兼容 Android 11 存储分区的用法进行 SD 卡的写操作,毕竟 targetSDK >=30 的时候,直接像现在这样操作外部存储就会有问题了。当然,只是建议,可以后面慢慢做。

REBOOTERS avatar Nov 23 '20 05:11 REBOOTERS

现在是指定下载路径: storagePrefix = Environment.getExternalStorageDirectory().getPath() + "/"; storageApkPath = storagePrefix + AppUtils.getAppName(mContext) + downloadApkUrlMd5 + ".apk";

你的项目需要自定义下载路径吗?强需求的话我下个版本改一下

Deprecated To improve user privacy, direct access to shared/external storage devices is deprecated. When an app targets Build.VERSION_CODES.Q, the path returned from this method is no longer directly accessible to apps. Apps can continue to access content stored on shared/external storage by migrating to alternatives such as Context.getExternalFilesDir(String), MediaStore, or Intent.ACTION_OPEN_DOCUMENT.

IsMrWu avatar Aug 05 '21 02:08 IsMrWu

准备支持Android 11 存储分区,希望年前能完成 ✅

AnyLifeZLB avatar Jan 13 '22 05:01 AnyLifeZLB