Google How to Launch setting page from Windows Phone 8 C# app | SubramanyamRaju Xamarin & Windows App Dev Tutorials

Monday, 23 December 2013

How to Launch setting page from Windows Phone 8 C# app

Introduction:

Windows Phone application is not allowed to modify some of the device’s settings directly.As a developer we can't access the phone functionality directly.And so alternative way  is "launch the settings screen " from the our app.However one of the most wanted functionality is added in "WindowsPhone 8 sdk" is "URI schemes" 

This topic lists the URI schemes that can be used to launch built-in apps. Many of the apps built into Windows Phone can be launched from your app by calling LaunchUriAsync(Uri), passing in a URI that uses the scheme associated with the app you want to launch. 


Source File at :WP8URISchemes

Note: URI schemes are not supported in windowsphone 7 sdk

By usign URI schemes we can easily launch "Airplane Mode Settings,Bluetooth Settings,email and accounts settings,Location Settings,Lock Screen settings,Battery Saver settings,Screen Rotation settings for Windows Phone 8 Update 3,Wi-Fi Settings...........etc and many more settings


For info you may visit WindowsPhone 8 URI schems


Please note following URI schemes are most useful in real time apps.


In your application, instead of asking the user to navigate to the Settings page, you can directly bring them to the page, programmatically.

To launch the various Settings pages, you can use the Launcher class with the LaunchUriAsync() method. As you are launching the pages asynchronously, you need to wrap these calls in a async method, like this:

1. Launch the Bluetooth Settings App using URI Scheme in Windows Phone 8

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-bluetooth:”));
 

2. Launch the AirplaneMode Settings App using URI Scheme in Windows Phone 8 

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-airplanemode:”));

 3. Launch the Cellular Settings App using URI Scheme in Windows Phone 8 

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-cellular:”));

 4. Launch the WiFi Settings App using URI Scheme in Windows Phone 8

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-wifi:”));

 5. Launch the Location Settings App using URI Scheme in Windows Phone 8

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-location:”));

 6. Launch the EmailandAccounts Settings App using URI Scheme in Windows Phone 8

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-emailandaccounts:”));

 7. Launch the Lock Settings App using URI Scheme in Windows Phone 8

C#
Windows.System.Launcher.LaunchUriAsync(new Uri(“ms-settings-lock:”));

 8. Sending Email using URI LaunchUriAsync in Windows Phone 8

C#
async private void Button_Click_1(object sender, RoutedEventArgs e) 
 
{ 
 
await Launcher.LaunchUriAsync(new Uri("mailto:awesomecoder@abundantcode.com")); 
 
}

9. Search for an App by Publisher in Windows Phone Store using URI Scheme from WP8 App

C#
// Function to Search for an App by publisher in Windows Phone Store using URI Scheme in Windows Phone 8 using C#. 
 
private async System.Threading.Tasks.Task SearchForAnApp() 
 
{ 
 
await Launcher.LaunchUriAsync(new Uri("zune:search?publisher=Abundantcode")); 
 
}

Windows Phone tutorials for beginners key points

This section is included for only windows phone beginners.However this article can covers following questions.Off course these key words are more helpful for getting more best results about this topic in search engines like google/bing/yahoo.. 

1. Launching the Location Settings App using URI Scheme in Windows Phone 8

2. How to Launch the Cellular Settings App using URI Scheme in Windows Phone 8?

3. Launching the Wifi Settings App using URI Scheme in Windows Phone 8

4. How to Search for an App in Windows Phone Store using URI Scheme from WP8 App?

5.Launch the Bluetooth Settings App using URI Scheme in Windows Phone 8

Related Posts:
  1. WindowsPhone 8 Custom URI Scheme:Launching other own apps from your app (C#-XAML)
Have a nice day by 

3 comments:

  1. Hi admin while i’m trying this code for a button click it is displaying an error as ‘The name Launcher does not exist in current context’
    What i have to do pls reply to my email as soon as possible.
    I'm using c-sharp.
    -ThanQ

    ReplyDelete
    Replies
    1. Make sure "The namespace is Windows.System, Windows.System.Launcher is a fully qualified class name to use in code" .And URI schemes are not supported in windowsphone 7 sdk

      Delete
  2. Dude you did a great favor for me.....
    I'm really thank full to you...
    and if you don't mind can you tell me whether can we call the Theme,Display,Call and brightness settings as well??
    what is the URI scheme for those??

    ReplyDelete

Search Engine Submission - AddMe