DownloadInstaller
DownloadInstaller copied to clipboard
请问怎么修改下载路径
作者你好,请问怎么修改下载路径
现在是指定下载路径: storagePrefix = Environment.getExternalStorageDirectory().getPath() + "/"; storageApkPath = storagePrefix + AppUtils.getAppName(mContext) + downloadApkUrlMd5 + ".apk";
你的项目需要自定义下载路径吗?强需求的话我下个版本改一下
现在是指定下载路径: storagePrefix = Environment.getExternalStorageDirectory().getPath() + "/"; storageApkPath = storagePrefix + AppUtils.getAppName(mContext) + downloadApkUrlMd5 + ".apk";
你的项目需要自定义下载路径吗?强需求的话我下个版本改一下
建议兼容 Android 11 存储分区的用法进行 SD 卡的写操作,毕竟 targetSDK >=30 的时候,直接像现在这样操作外部存储就会有问题了。当然,只是建议,可以后面慢慢做。
现在是指定下载路径: 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.
准备支持Android 11 存储分区,希望年前能完成 ✅