How to enable or disable Bluetooth in Windows Phone using C# ?

If you are a Developer and have an task to change or access the Bluetooth Settings via some user interaction , you can use the Launcher “ConnectionSettingsTask” to achieve it.

Just use the ConnectionSettingsType to Bluetooth and call the show method of the ConnectionSettingsTask . This will Launch the Bluetooth Settings Window and lets the user to change the Bluetooth settings or even enable or disable the Bluetooth.

You use the Launcher , use the namespace Microsoft.Phone.Tasks;

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

 

via WindowsPhoneRocks.com

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


x

Interesting BlogPosts to read

How to get an Enumerator from range of elements from ArrayList in C# ?
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of ...
How to check for the column name in an SqlDataReader Object in C# ?
When working in ADO.NET for data access , there are times when you want to check to see if a column ...
STK launches its Waterproof Bluetooth Speaker – ‘flasko’ only for Rs. 5999/-
STK Accessories, a pioneer of mobile phone accessories expands its product line with the addition of...