Windows Phone 8.1 - BackgroundTransferStatus for BackgroundUpload

I use BackgroundUploader to upload images / videos from CameraRoll to the storage service. This is a WinRT application on Windows Phone 8.1.

This works fine until a large number of files are downloaded. I was expecting problems using the battery and the processor, so I check the BackgroungTransferStatus of all UploadOperations and am going to show a message to the user if we come across PausedSystemPolicy Status. This is the expected status if the phone decided to pause the download.

My problem is that although the download is definitely paused (it does not send HTTP messages), the status continues to say โ€œRunโ€. Moreover, the cancellation of the download operation is not affected. He still continues to sit there, saying "Run" without sending bytes and receiving no response. In the end, it resumes loading, but we seem to quickly encounter any limit, and we pause again. I understand the need for restrictions, this concerns me, which I'm worried about.

Why does a boot that has been paused still have a status of "Launch"? Has anyone experienced something like this?

+5
source share
1 answer

This can happen if several downloads are already running.

Suppose that 5 downloads are loaded, and you put the sixth. The sixth download will not start immediately if you have not checked it with BackgroundTransferPriority.High . The status of the operation is displayed as working, but it will not start sending or receiving data until the slot is available. The suspension of an operation does not take effect immediately if the operation is in the queue. But as soon as the operation becomes active, a pause instruction will be applied to the operation.

As a job, you can keep track of progress. If the download does not provide any progress, you know that it may be in the queue.

0
source

Source: https://habr.com/ru/post/1207652/


All Articles