Tuesday, November 2, 2010

How to launch the Marketplace in the Windows Phone 7 Emulator

You probably noticed by now that the default Windows Phone 7 emulator only contains Internet Explorer and the Settings. I stumbled upon a tip from Daniel Vaughan about Launchers and Choosers today and I learned about a task that can start up the Marketplace Hub. Unfortunately you will have to create an application that calls into the Launcher API to accomplish this.

Here's what you need to do:

1) Create a new Silverlight Windows Phone Application
2) In your MainPage.cs and add a using directive to the Microsoft.Phone.Tasks namespace.
3) Add the following in the constructor of MainPage.cs after calling the InitializeComponent() method:

var task = new MarketplaceHubTask();
task.ContentType = MarketplaceContentType.Applications;
task.Show();

4) Launch the application and you should be good to go.

Here's how the Marketplace looks like on the emulator:



Click here to see a list of supported launchers and choosers for Windows Phone 7. You can read more about Launchers and Choosers here.

1 comment:

Robert Shurtleff said...

Thanks for the tip.

Note however, that while you can search and view the info page for an app, you can not actually install them as you have to have your liveid setup, and the emulator does not support setting up your liveid.

MSDN states:

MarketplaceReviewTask


Allows an application to launch the Windows Phone Marketplace client application and display the rate and review page for the specified product. A user must have a Windows Live ID to write a review.


Opening a product's rate and review page displays an error because there is no Windows Live ID.