I am developing one android app where I need to download a file from the Azure blob I am able to download the file using the following code but I also want to show a progress bar while a file is downloading because it will be a large file say around 1/2 GB.
Gradle dependency:
implementation 'com.microsoft.azure.android:azure-storage-android:2.0.0'
How I am downloading the file:
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");
}
How can I achieve the download progress?