How to: Pause/Resume BackgroundTransferRequest or BackgroundTransferService in Windows Phone

Recently, I came across a requirement where I need to perform a background download; along with pause and resume support in Windows Phone 8. The first part is quite easy and straightforward. You can create a BackgroundTransferRequest and add it to the BackgroundTransferService. Done! The BackgroundTransferService class will take care of the background operations for you.

Now, coming to the pause-resume support. I think with current stock APIs for background operations, it's not possible to perform a pause-resume. Why it's so? Because few HTTP headers - If-Modified-Since, If-None-Match, If-Range, Range and Unless-Modified-Since are reserved for BackgroundTransferRequest. From these reserved headers, Range header can be used to download a resource partially by specifying the starting and ending bytes, something like Range: bytes=500-999.

Being said, you can implement a pause-resume or partial download using WebClient class and specifying HTTP Range header value. Unfortunately, this runs in foreground only. Means, while downloading a resource you "should" remain in the UI itself.

Hope this helps.

Thanks

Bing’s search suggestion now has Quick Preview

Just now, I found something surprising and interesting in Bing’s search suggestion - Quick Preview. This quick preview will give you some quick information within the search suggestion UI, so that you can move (using keyboard/mouse navigation) through the suggested search term to see "that" extra information, without actually going into the search results page. A quick screenshot is below:

image

If you move your selection to ‘iron man 3’, then you’ll get a preview like

image

Similarly, if you move the selection to ‘iron man 2’, then you’ll get a preview like

image

Well, this preview is not limited to movies alone. Here are some other search results

image

image

I think right now this feature is limited to United States. If you couldn’t get this quick preview then please do try changing your country/region to United States.

I'm a Bing use for past 4+ years.

Hope you like it.

Cheers,

- A