0

I need to detect app is Online or Offline. According to network availability I can sync data to sqlite and if app is Offline run app on sqlite data.

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
Sandeep
  • 1
  • 2

1 Answers1

0
public static bool IsInternet()
{
    ConnectionProfile connections = NetworkInformation.GetInternetConnectionProfile();
    bool internet = connections != null && connections.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess;
    return internet;
}

See this question.

Community
  • 1
  • 1
Arctic Vowel
  • 1,492
  • 1
  • 22
  • 34