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

Windows Phone Marketplace (free apps) in your pocket

DZone's Guide to

Windows Phone Marketplace (free apps) in your pocket

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Downloading applications from the Windows Phone Marketplace is nothing new – people do it on a daily basis. Each application is basically a XAP package containing the application data and the executable part itself. By default, it is not possible to access the installed XAPs, but there is a way to access XAPs before they even get on the phone.

I saw a tweet from Justin Angel recently, stating that he decided to download the entire Windows Phone Marketplace.

So you might be wondering – how is this possible? If you saw my project – Zune Data Viewer, then you probably know that all the information the Zune software is processing is going through XML feeds. Zune is the central connection point for the App Marketplace as well, so I fired up Wireshark and listened to the endpoints Zune was activating when requesting information about various lists of applications.

There I have it – the core URL:

http://catalog.zune.net/v3.2/en-US/apps/?clientType=WinMobile%207.1&cost=free&store=Zest&orderby=downloadRank

I can easily skip the last parameter - orderby, since I don’t care about order at this point. The resulting feed contains information about free applications for Windows Phone 7.1 (Mango). Here is what is in the feed:

There is various information regarding the application, like the rating, categories it falls into, the release date, tags and offers available for this product at the time of the query. But there are no pointers to where I can get the XAP package. One thing to remember here is that every application in the Marketplace is identified by a GUID. And that GUID in the image above is presented in the a:id tag.

The next step would be to get more details on this specific application. To do this, I need to follow the next feed URL:

http://catalog.zune.net/v3.2/en-US/apps/APP_ID?clientType=WinMobile%207.1&store=Zest&store=ATT&store=HTC

Since I am testing this from a HTC device, the store name is ultimately appended to the URL. The detailed description of the application looks something like this:

So there is the URL! Notice one thing – the ID used in the XAP URL is not the same as the application ID. So you cannot download the application simply considering its GUID – you will have to download the extra descriptor feed to get the URL. And now we have all the necessary information.

Another question that you might be asking at this point – how exactly do you get the GUIDs for all applications in the Marketplace? The first feed only returns 100 results – obviously not all free apps out there.

Take a closer look at the very first feed header:

We now have markers, that allows us to navigate through different parts of the Marketplace. The URLs are relative to catalog.zune.net.

All you need to do now is iterate through the endpoints to sequentially acquire the XAP packages.

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}