I need some clarification on how these 2 entities interact...
If I use the BackgroundTransferService only to upload some files, the moment I move away from the application, the upload will stop. When I come back to the application, the upload will resume. Is that correct? Or is the upload lost?
However, if I wanted to make sure that the file will upload regardless of whether the user moves away from the application, I should kick off the BackgroundTransferService upload inside of a class that implements the ScheduledTaskAgent. Is that correct? If this is the case, how can tha开发者_高级运维t be done? BackgroundTransferService reports its progress via Events, thus I can't call NotifyComplete from the OnInvoke method of the ScheduleTaskAgent.
Am I going about it the wrong way?
No, this is not correct. If the background transfer is initiated, it is inserted in a queue that is dependent on a set of multiple factors, including other pending background transfers (from other third-party application) and the general network speed. You can find additional details here. That queue is processed, even if the application is tombstoned.
精彩评论