How to Launch WP8 built-in Apps using URI Schemes?



In Windows Phone 7, we had four network settings page that we can invoke using the ConnectionSettingsTask. We had no other APIs to launch other settings page but in Windows Phone 8 Microsoft exposed few schemas for invoking these settings pages.

 

In addition to the existing pages, now we have few more as addition. Today in this post we will learn how to open those settings page using proper URI schemes.

 

In addition to the Airplane Mode, Bluetooth, Cellular and Wi-Fi settings page, now we have few more settings page which we can now invoke from our application. Those new settings pages are Location, Accounts, Email & Accounts and Lock Screen.

 

There is also a API changes to invoke those settings page from your Windows Phone 8 application. Instead of calling the ConnectionSettingsTask, we have to use the “Windows.System.Launcher.LaunchUriAsync(new Uri(URI_SCHEME))” method with proper schema definition as part of the Uri parameter.

 

Here is the reference table for the proper URI scheme definition:

 

Settings Page URI Scheme
Launch Airplane Mode Settings Page
ms-settings-airplanemode:
Launch Bluetooth Settings Page
ms-settings-bluetooth:
Launch Cellular Settings Page ms-settings-cellular:
Launch Wi-Fi Settings Page ms-settings-wifi:
Launch Location Settings Page ms-settings-location:
Launch Account Settings Page ms-settings-accounts:
Launch Email Account Settings Page ms-settings-emailandaccounts:
Launch Lock Screen Settings Page ms-settings-lock:

 

 

In case you want to call the specific settings page, you have to call the LaunchUriAsync(…) method from the Windows.System.Launcher namespace and have to pass the Uri with proper schema definition as parameter.

 

Here is how you have to call the method (generic way):

 
// set proper URI_SCHEME from the definition table as the URI parameter
Windows.System.Launcher.LaunchUriAsync(new Uri(URI_SCHEME));

 

To call individual settings page, you have to call like this:

 
// to launch the Airplane Mode Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-airplanemode:"));
 
// to launch the Bluetooth Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-bluetooth:"));
 
// to launch the Cellular Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-cellular:"));
 
// to launch the Wi-Fi Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-wifi:"));
 
// to launch the Location Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-location:"));
 
// to launch the Account Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-accounts:"));
 
// to launch the Email Account Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-emailandaccounts:"));
 
// to launch the Lock Screen Settings page
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-lock:"));

 

 

I hope that, it will help you to integrate various settings page of Windows Phone 8 device in your WP8 application. There are few more things that you can do with the LaunchUriAsync(…) method and Scheme which we will discuss in future post. Till then enjoy working with it. Happy Coding.

9 comments

  1. Still no date-time settings launcher

    ReplyDelete
  2. Hi Kunal

    Thanks for Sharing useful information..
    when i write this on button click event..Error appears..
    Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-airplanemode:"));

    Error says that:
    Usage:
    bool x =await LaunchUriAsync

    Please help me to solve this ...

    ReplyDelete
  3. As it is an async call, you have to use the await async keywords during the call.

    ReplyDelete
  4. Hi Kunal

    Can i use these uri schemes with shell tiles when we create a new shell tile ..

    Please help me to solve this ...

    ReplyDelete
  5. Yes you can but not directly. You have to call it explicitly from your code.

    ReplyDelete
  6. hi how we can got to tap+send Uri??

    i tried two ways "ms-settings-tap+send" and "ms-settings-tapsend"
    But no use..

    Please help

    ReplyDelete
  7. but how to launch build-in calculator,with it?

    ReplyDelete
  8. Hi Kunal, your post is very usefull. Please let me know how to pass value to built-in app? for e.g. want pass value to email setting app

    ReplyDelete


 
© 2008-2014 Kunal-Chowdhury.com | Designed by Kunal Chowdhury
Back to top