[英]download large file from azure blob storage using java/android with progress
我正在开发一个 android 应用程序,我需要从 Azure blob 下载文件我可以使用以下代码下载文件,但我也想在文件下载时显示进度条,因为它将是一个大文件说大约 1/2 GB。
Gradle依赖:
implementation 'com.microsoft.azure.android:azure-storage-android:2.0.0'
我如何下载文件:
CloudStorageAccount account = CloudStorageAccount.parse(storageConnectionString);
CloudBlobClient serviceClient = account.createCloudBlobClient();
CloudBlobContainer container = serviceClient.getContainerReference("test");
Iterable blobs = container.listBlobs();
for (Object listBlobItem : blobs) {
ListBlobItem blob = (ListBlobItem) listBlobItem;
CloudBlockBlob cloudBlob = (CloudBlockBlob) blob;
// Downloading files from the container
cloudBlob.downloadToFile(fileSample.getAbsolutePath());
Log.e("INFO", "File downloaded");
}
我怎样才能达到下载进度?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.