Using the ConnectionSettings Task for Windows Phone
Join the DZone community and get the full member experience.
Join For Free
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:
the user can set the device network setting to any of the following:
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();
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();
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();
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();
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/
Opinions expressed by DZone contributors are their own.
Comments