Search code examples
xamarinxamarin.androidxamarin-studio

Background service to detect network status in Xamarin.Android


I am developing Xamarin.Android app. In my app , I want to implement a background service , which will run indefinitely to detect changes in network status. i.e. if network connection goes off , it should send such notification . It should send notification too when network connection becomes on(device got a network connection). Can anyone tell me how to implement such service in Xamarin.Android ?


Solution

  • How much reasearch did you do?

    Have a look on the ConnectivityManager: http://developer.xamarin.com/recipes/android/networking/networkinfo/detect_network_connection/

    You could make a listener yourself, which fires an event when it changes?

    Network listener Android and How can I monitor the network connection status in Android?