0

Adding BackgroundTransferRequest's to the BackgroundTransferService once the app is in the background is successful, but the new requests don't actually run until the app comes back to the foreground. Not so great for my scenario of downloading lots of small files that may take a fair amount of time to complete.

I imagine Microsoft has probably implemented this behavior by design(?), but does anyone know a way around this or an alternative approach?

A bit of background to the problem:

I'm developing a Windows Phone 8 map app that allows sections of maps to be downloaded and cached for offline use. This process can lead to 1,000's of map tiles needing to be downloaded.

I've created a process that spawns the full limit of 25 BackgroundTransferRequest's, then adds more to the BackgroundTransferService as requests complete. This all works fine until the app actually goes in to the background.

I have considered doing some web server side processing to allow tiles to be bundled in to a zip and downloaded as a single request, but this is extra complication and will result in twice the space being required on the phone to complete the download and then extract the files before deleting the original package. But, ideally I'd like to find a way to force new BackgroundTransferRequest's to start running in the background.

Gavin
  • 5,629
  • 7
  • 44
  • 86

1 Answers1

0

It's not clear what your actual question is but I'd definitely recommend bundling them into a zip file and then downloading that. It's almost always easier to work with a single file than thousands.

If disk space is really a genuine issue (not just a theoretical one - I've put thousands of map tiles in under 20mb before, but it will depend on image complexity & quality) then you could make a few zip files. then you'd avoid the BTR issue and not take up as much disk space (even temporarily).

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • Thanks Matt. Ideally I'd like to find a way around the BackgroundTransferRequest issue that would allow me to run new ones in the background. Regarding map tiles, it's easier to pull the small files as prevents extra load on the server downloading and bundling 1,000's of files up (and extra effort). Depending on the size of map they select, the user could be requesting a few GB of tiles. – Gavin Jul 19 '13 at 06:18