How to Launch Built-in Apps from Windows Phone App code using LaunchUriAsync
LaunchUriAsync method can be used instead of Windows Phone launchers to open primary apps or to launch system applications in Windows Phone app development.
Using LaunchUriAsync method to launch built in apps is new with Windows Phone 8 for developers.
For example, if you want to provide a function that Windows Phone app user can open bluetooth settings or wi-fi settings, you can use LaunchUriAsync method with corresponding URI scheme.
LaunchUriAsync URI Scheme List
Although Windows Phone launchers and LaunchUriAsync method provide similar functionalites, some of the following functions listed in below table are only available with LaunchUriAsync method for developers
|http:[URL]||To launch web browser and navigate to specific web URL address|
|mailto:[email-address]||To launch email app with To is set to email-address specified|
|ms-settings-accounts:||To open Account Settings app|
|ms-settings-airplanemode:||To launch Airplane Settings app|
|ms-settings-bluetooth:||To launch Bluetooth Settings app|
|ms-settings-cellular:||To open Cellular Settings app|
|ms-settings-emailandaccounts:||To launch Email and Accounts Settings app|
|ms-settings-location:||To display Locations Settings app|
|ms-settings-lock:||To launch Lock Screen Settings app|
|ms-settings-wifi:||To open Wi-Fi Settings app|
|zune:navigate?appid=[App Id]||To navigate to app details page on Windows Phone Store|
|zune:reviewapp||To open review page for calling app on Windows Phone Store|
|zune:reviewapp?appid=[App Id]||To launch reviews page for specified app|
|zune:search?[search parameter]=[value]||To search Windows Phone Store|
|zune:search?keyword=[search keyword]&contenttype=app||To search Windows Phone apps by keyword|
|zune:search?publisher=[publisher name]||To launch Windows Store and search publishers apps|
LaunchUriAsync Sample Windows Phone App Code
Let's make an example Windows Phone app and try to open the Wi-Fi Settings of the Windows Phone 8 smartphone using LaunchUriAsync method with corresponding URI scheme.
Uri uri = new Uri("ms-settings-wifi:");
As Windows Phone app developers will realize there is no need to import a namespace like Microsoft.Phone.Tasks
Let's make an other example to show how easy to open settings app using LaunchUriAsync method for app developers.
Following code is used to launch Bluetooth settings on user's Windows Phone 8 device.
Uri bluetoothUri = new Uri("ms-settings-bluetooth:");