locked
Show Bluetooth settings Windows Phone 8.1 RRS feed

  • Question

  • Hi,

    In Windows Phone 8 Silverlight you could show the Bluetooth settings with this:

    private void showBluetoothSettings()
            {
                ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
                connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.Bluetooth;
                connectionSettingsTask.Show(); 
            }

    However, this doesn't work in 8.1 - Is there a way of doing this in Windows Phone 8.1 runtime?

    Thursday, September 4, 2014 7:48 PM

Answers

  • Hi,

    The easiest way to launch Bluetooth settings app is by calling LaunchUriAsync(Uri) passing in the URI that use the scheme associated with the Bluetooth app ("ms-settings-bluetooth:")...

    Xaml :

    <Button Content="Bluetooth Settings" HorizontalAlignment="Left" Margin="135,275,0,0" VerticalAlignment="Top" Tapped="showBluetoothSettings"/>

    Code Behind :

    async void showBluetoothSettings(object sender, TappedRoutedEventArgs e)
            {
                await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-bluetooth:"));
            } 


    The best is still to come ;)

    • Proposed as answer by Oliver Ulm Friday, September 5, 2014 6:07 AM
    • Marked as answer by Arsenalfandan Friday, September 5, 2014 7:57 AM
    Friday, September 5, 2014 5:57 AM

All replies

  • Hi,

    The easiest way to launch Bluetooth settings app is by calling LaunchUriAsync(Uri) passing in the URI that use the scheme associated with the Bluetooth app ("ms-settings-bluetooth:")...

    Xaml :

    <Button Content="Bluetooth Settings" HorizontalAlignment="Left" Margin="135,275,0,0" VerticalAlignment="Top" Tapped="showBluetoothSettings"/>

    Code Behind :

    async void showBluetoothSettings(object sender, TappedRoutedEventArgs e)
            {
                await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-bluetooth:"));
            } 


    The best is still to come ;)

    • Proposed as answer by Oliver Ulm Friday, September 5, 2014 6:07 AM
    • Marked as answer by Arsenalfandan Friday, September 5, 2014 7:57 AM
    Friday, September 5, 2014 5:57 AM
  • Brilliant, thanks Christian! That's just what I was looking for!
    Friday, September 5, 2014 7:58 AM