none
Azure file upload delay in android

    Question

  • We are working with Android app to upload files to our azure storage. We are using Azure Storage android library (azure-storage-android:0.7.0). We are facing issue while uploading image to Storage. The issue is uploading image getting more than few minutes for maximum file size 65KB. We are having good wifi internet connection. This is not happen every time. It may happen occasionally. 

    we are using the code is below to upload

    try

    {

        // Retrieve storage account from connection-string.

        CloudStorageAccount storageAccount = CloudStorageAccount.parse(storageConnectionString);

        // Create the blob client.

        CloudBlobClient blobClient = storageAccount.createCloudBlobClient();

        // Retrieve reference to a previously created container.

        CloudBlobContainer container = blobClient.getContainerReference("mycontainer");

        // Define the path to a local file.

        final String filePath = "C:\\myimages\\myimage.jpg";

        // Create or overwrite the "myimage.jpg" blob with contents from a local file.

        CloudBlockBlob blob = container.getBlockBlobReference("myimage.jpg");

        File source = new File(filePath);

        blob.upload(new FileInputStream(source), source.length());

    }

    catch (Exception e)

    {

        // Output the stack trace.

        e.printStackTrace();

    }

    Please advise.

    Thursday, December 29, 2016 5:48 AM

All replies

  • Hi,

    Thank you for contacting Microsoft forums. We are pleased to answer your query.

    To clarify, are you uploading one file or many?

    Kindly refer the below article for Microsoft azure Storage Performance and Scalability Checklist:

    https://docs.microsoft.com/en-us/azure/storage/storage-performance-checklist

    I hope that the reply will assist you in getting your query addressed. In case you require further assistance, please do reply to the thread as we are always available to your queries.

    Regards,

    Vikranth S.

    Kindly click "Mark as Answer" on the post that helps you, this can be beneficial to other community members reading the thread. And Vote as Helpful.

    Thursday, December 29, 2016 12:56 PM
    Moderator
  • To clarify, are you uploading one file or many?

    uploading single file at a time.

    Friday, December 30, 2016 4:45 AM
  • Hello,

    To upload a single blob quickly, your client application should upload its blocks or pages in parallel (being mindful of the scalability targets for individual blobs and the storage account). Note that the official Microsoft-provided RTM Storage Client libraries (.NET, Java) can do this. For each of the libraries, use the below specified object/property to set the level of concurrency:

    • .NET: Set ParallelOperationThreadCount on a BlobRequestOptions object to be used.
    • Java/Android: Use BlobRequestOptions.setConcurrentRequestCount()
    • Node.js: Use parallelOperationThreadCount on either the request options or on the blob service.
    • C++: Use the blob_request_options::set_parallelism_factor method.

     

    I hope that the reply will assist you in getting your query addressed. In case you require further assistance, please do reply to the thread as we are always available to your queries.

     

    Regards,

    Vikranth S.

     

    Kindly click "Mark as Answer" on the post that helps you, this can be beneficial to other community members reading the thread. And Vote as Helpful.

    Friday, December 30, 2016 11:24 AM
    Moderator