Tuesday, September 29, 2015

Phone calls Windows Phone 8 vs. Windows Phone 8.1

Problem:

I am migrating a windows phone 8 app to windows phone 8.1.  The move forward involved changes to the namespaces where the phone tasks occur

Solution:

Making a call in Windows Phone 8
  1. Add the following statement to your code.
    using Microsoft.Phone.Tasks;
  2. Add the following code to your application wherever you need it, such as in a button click event. To test this procedure, you can put the code in the page constructor. This is the code to launch the task.

    PhoneCallTask phoneCallTask = new PhoneCallTask();
    phoneCallTask.PhoneNumber = "2065550123";
    phoneCallTask.DisplayName = "Gage";
    phoneCallTask.Show(); 


Making a call in Windows Phone 8.1

Add the following code to your application wherever you need it, such as in a button click event. To test this procedure, you can put the code in the page constructor. This is the code to launch the task.


Windows.ApplicationModel.Calls.PhoneCallManager.ShowPhoneCallUI("phone number", "display name");

    Source:

    1. https://msdn.microsoft.com/de-de/library/windows/apps/hh394025(v=vs.105).aspx
    2. http://stackoverflow.com/questions/23555640/make-a-phone-call-in-windows-phone-8-1


    No comments:

    Post a Comment