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

SMF Player not playing video in Windows Phone 7 device

Last week, I’s working on an almost ready Windows Phone project which streams video in SMF (Silverlight Media Framework) Player, for adding some additional features. After the feature integration, I tested it thoroughly in Emulator. To see the app behavior in a real device, I deployed the app on to my Windows Phone 7 device. Bang!!! Nothing is playing. When I try to load video, the player stays still - no audio, no video, not even any video/media related SMF Player events are fired at all. After spending hours of investigation, my colleague pointed out that I haven’t installed Smooth Streaming Client 2.0 on my developer machine.

Installed it, deployed the app to my device. And, Yup! The video starts playing Smile

Did you ever got stuck for hours for silly issues? Winking smile

How I installed wp7.8 update without disconnect hacking in Samsung Omnia W device

Haah! After waiting for a longtime, I finally got the 7.8 update for my Samsung Omnia W (mango device) and that too without disconnect hack.

Like every other desperate and frustrated wp7.5 Samsung device users, I was waiting for months to get the wp7.8 update. Unfortunately, I own a Samsung Omnia W device. I said “unfortunately” because Samsung treats windows phone as a second-class smartphone since they invests heavily on droid platform. I contacted Samsung India Support (via chat) every month after the wp7.8 announcement but they replied - they don’t have any official release date as of now.

Like you, I tried a lot to install the wp7.8 update using disconnect hack. But, was not working in my case and I start losing all my patience by plugging-unplugging LAN cable and toggling my wi-fi connectivity.

Being frustrated and curious, I spend some time analyzing the data passing over the wire using Wireshark just want to know what’s happening under the hoods. Tried out some combinations. Charmingly, it worked!!! New technique (oh, yes! It’s a hack) to install wp7.8 update on my Samsung device.

Well, the steps are almost same like every other techniques but with a slight difference. You don’t need to disconnect the internet connection. But still, the key is little patience and effort.

Here goes the step:

  1. Connect your phone to PC via USB Connector
  2. Zune will start automatically. Wait for few minutes. If you have any update, Zune will directly show the update window. Click and update. (Lucky!) Else go to step 3
  3. If no update window is displayed. From the right-top corner, navigate to Settings –> Phone –>Update. If an update is available, install the update, else go to step 4
  4. Click on any other menu (in the left-side row). Wait for 10-15 seconds then click on Update again. Repeat this until you get any update. (I told you, you need patience. I got the update after doing this 5-7 times)
  5. Congratulations. Your Windows Phone is updated.

Wait, is that all?

If you have got the updates after following these steps. I know, how excited you are. Just want to add one point to your excitement.

Once you get the update. Zune will check for additional updates. If any update is available, Zune will automatically install the update. Now, what if there is no additional updates? Then, I want you to check your OS version (Device –> Settings –> About).

Following are the series of update that you’ll get as part of the update:

  1. 7.10.8779.8
  2. 7.10.8783.12
  3. 7.10.8858.136
  4. 7.10.8860.142
  5. 7.10.8862.144

If your OS version number is lower than 7.10.8862.144, then I suggest you to follow the above mentioned steps to install remaining updates.

Here goes the series of images that I took during the update, in case if you want to see

WP_20130328_007 (1)

samsung_omnia_w_zune_update

samsung_omnia_w_zune_update_2

samsung_omnia_w_zune_update_4

samsung_omnia_w_zune_update_5

samsung_omnia_w_zune_update_6

samsung_omnia_w_zune_update_7_after_wp78

samsung_omnia_w_zune_update_8

samsung_omnia_w_zune_update_9

samsung_omnia_w_zune_update_10

I know how tiring it is to do a tedious and time-consuming hack to get an update. From my experience, I would say go with Nokia. They are the only brand that can be trusted blindly. Samsung will show no love to Windows Phone.

Hope this helped.

Thanks.