You might already know that, Windows Phone 8.1 SDK came with few API changes targeting the Windows Runtime. If you are a developer and looking to launch the phone dialler from your app, this post will help you to know the changes.

 

In this post we are going to discuss “How to programmatically do a Phone Call in Windows Phone 8.1” with a comparison between the API changes.

 

 

You might already know that, many APIs have been changed in Windows Phone 8.1 if you compare them with it’s previous version (i.e. WP8). I have already blogged few of them. You can read them here:

How to create a Phone Call in Windows Phone 8.0 or earlier?

Earlier to Windows Phone 8.1, I mean in Windows Phone (Silverlight) applications, we had to call the PhoneCallTask API. It’s a sealed class present in “Microsoft.Phone.Tasks” namespace and exposes two properties named “DisplayName”, “PhoneNumber”. It also exposes a method named “Show”, when called, launches the PhoneCallTask and dials the specified number.

 

var phoneCallTask = new PhoneCallTask
                    {
                        DisplayName = "Kunal Chowdhury",
                        PhoneNumber = "9876543210"
                    };
phoneCallTask.Show();

 

How to create a Phone Call in Windows Phone 8.1?

If you are building Windows Phone 8.1 universal app, this has been changed a bit. You will not find the PhoneCallTask now. Rather, Microsoft exposed a new API that launches the built-in phone call UI with the specified phone number and display name. “PhoneCallManager” is a new static class placed in “Windows.ApplicationModel.Calls” namespace provides a static method named “ShowPhoneCallUI” and takes two string parameters called PhoneNumber and DisplayName.

 

PhoneCallManager.ShowPhoneCallUI("9876543210", "Kunal Chowdhury");

 

End Note

Hope, this post will help you to understand the changes between Windows Phone 8.1 SDK and older versions of the SDK. Don’t forget to read my other posts on Windows Phone 8.1 (What changed for #WPDev) series mentioned above.

 

Thanks for visiting my blog. Bookmark this site for future reference. Share the posts that you liked and help others in your network to find the already available content easily. Don’t forget to subscribe to my blog’s RSS Feed and Email Newsletter to get regular updates about the posts directly delivered to your inbox. Apart from this blog, I am also available in Twitter, Facebook and Google+. Do connect with me to find out what I share over the network.

Have a question? Or, a comment? Let's Discuss it below...

dhgate

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.