Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using the ConnectionSettings Task for Windows Phone

DZone's Guide to

Using the ConnectionSettings Task for Windows Phone

· Mobile Zone
Free Resource

ConnectionSettings Task allows the user to set and adjust the device network settings. ConnectionSettings task is defined in Microsoft.Phone.Tasks namespace as the following:

image


The user can set the device network setting to any of the following:

image


If you want to set the Network connection setting to WiFi, you can set it by doing this:

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi;
connectionSettingsTask.Show();

 

image


If you want to set Network connection setting to Bluetooth, you can set it like this:

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.Bluetooth;
connectionSettingsTask.Show();

 

image


If you want to set Network connection setting to Cellular, you can set it like this:

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.Cellular;
connectionSettingsTask.Show();

 

image


If you want to set Network connection setting to Airplane mode, you can set it like this:

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.AirplaneMode;
connectionSettingsTask.Show();

 

image


In this way you can set the network setting of the device using the ConnectionSettings task. I hope this post is useful to you and thanks for reading!


Source: http://debugmode.net/2012/01/18/how-to-use-the-connectionsettings-task-for-windows-phone/
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}