Windows Phone Marketplace (free apps) in your pocket
Join the DZone community and get the full member experience.Join For Free
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:
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:
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.
Opinions expressed by DZone contributors are their own.