Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How To Get WP7-sized Bing Wallpapers

DZone's Guide to

How To Get WP7-sized Bing Wallpapers

· Mobile Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

Bing is famous for having some great pictures updated on a daily basis depending on the region where the search is performed. The official Bing (search) app for Windows Phone does exactly the same thing. I was wondering how it is possible to get those images. Initially, I thought about doing a request to http://bing.com and reading the resulting HTML, but then I found out that there is an official dedicated web service that allows downloading any Bing images up to 6 days back, from any supported region.

The service I am talking about was discovered when I was analyzing the outgoing traffic from the search app. The service URL is the following:

http://appserver.m.bing.net/BackgroundImageService/TodayImageService.svc/GetTodayImage?dateOffset=0&urlEncodeHeaders=true&osName=wince&osVersion=7.10&orientation=480×800&deviceName=WP7Device&mkt=en-US&AppId=1

Let’s look at the useful parameters.

  • dateOffset – here is where you specify what image to obtain, relative to the current date. If it is 0, the image returned will be the one assigned for today for the current region. This parameter accepts negative values up to –6 (6 days back).
  • orientation – set the image resolution. The default is 480×800, but you can also set it to 1024×768 and 800×480 (landscape mode – thanks to Dejan Minic for mentioning this) .
  • mkt – the region, for which the image should be obtained. Examples: en-GB, fr-FR.

That’s all you need to consider for now. Keep the OS identifiers in place, because some parameters are required, even if the value is not directly used.

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}