I am developing a Windows Phone 8 App with C# and my app needs to realize automatically when the network availability has changed.
So, when the Windows Phone is suddenly connected to the internet I need to take some actions, but I really do not know how to check this. I don't want to set a Timer, running constantly in a Thread for checking this every couple of seconds.
Is there any Method (similar to the OnNavigatedTo
method), that is launched automatically, when the phone connects to the internet?
If so, what is the best and most efficient way to implement this?
Thank you for all tips and your help in advance!
All what you need is NetworkAvailabilityChanged event. You can find all available information in the DeviceNetworkInformation Class.