Click here to Skip to main content
15,867,686 members
Articles / Mobile Apps / Windows Phone 7

Invoking People Hub in Windows Phone 7 Emulator

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
26 Nov 2011CPOL2 min read 20.6K   236   10  
Invoking People Hub in Windows Phone 7 Emulator

Introduction

Many a times, your application would require to access the contacts of the user. Fortunately, the Windows Phone Emulator provides you with a few dummy contact entries which you can access.

Image 1

But these contacts are bare bones and they don't feature data like photo, birthday, anniversary, personal address and so on.

Image 2

If you are a Windows Phone 7 Developer, you must have used the Emulator some or the other time. If you remember well, you will not have seen these screens before on the emulator. The only icon which shows up when you fire up the Emulator is of Internet Explorer. On clicking the right arrow, you get a list of Your application (if deployed), Internet Explorer, Settings.

I am not sure why Microsoft did not put up the People Hub Tile on Windows Phone Emulator but there is a workaround of invoking it and do whatever changes you need. You can even add contacts, link with accounts for Windows Live, Gmail, Outlook, Facebook and others.

Using the Code

Create a New Windows Phone Application project in Visual Studio. On MainPage, just add a Button and double click on the Button which will create a Click Event Handler for the Button.

In the Code View, find the event handler (it should be named as button1_Click or such) and type this code.

C#
PhoneCallTask task = new PhoneCallTask();
task.PhoneNumber = "000000000";
task.DisplayName = "Test user";
task.Show();

You would need to add a Using statement for Microsoft.Phone.Tasks. Press Ctrl + F5 to start the project.

What we are doing here is initiating a phone call (don't worry, you won't get charged as the Emulator uses Fake GSM). Once your phone is connected and a timer starts counting your call seconds…

Image 3

…click on “add call” button which will put your call on Hold and show you a screen with options to dial another number.

Image 4

In the Application Bar at the bottom, click the third button with Diary icon which will fire up your People Hub for you to tinker around with.

Image 5

You can now click on the Status Bar at the top and end the call. Don't worry, it won't close down the People Hub. Once you ended the call, the emulator will return to People Hub screen for you to tinker around with. You can make changes to the default contacts, create your own contacts, link with accounts such as Windows Live, Outlook, Gmail, etc.

Once you link an account say Gmail, you can even read mails from here.

History

  • 26th November, 2011: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Hyperbees Technologies Pvt. Ltd.
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --