I would like to know whether the following are possible in the current windows phone 7 SDK:
- Getting the device’s OS version
programmatically. - Detecting programmatically
whether the data connection is
available in the device or not - Programmatically getting the type of network
connection that the device is
currently having either wifi or LAN
You can get the OS version by doing using System.Environment.OSVersion. The numbers at the end will be the current running version. You can confirm this on your phone by going to
Settings...Aboutand seeing if the numbers match.You can use the NetworkInterface.GetIsNetworkAvailable method to determine if there is any data connection available.
To determine the type of connection, you can use NetworkInterface.GetInternetInterfaceType. This will return a valume of enum NetworkInterfaceType. If the value is
Ethernet, the user is plugged into the computer and using its data connection. (Of course, you should test the values returned to confirm that they’re what you expected them to be).