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

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

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/

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}