{"id":119,"date":"2022-11-20T18:32:31","date_gmt":"2022-11-20T18:32:31","guid":{"rendered":"https:\/\/learnmobiledevelopment.com\/?p=119"},"modified":"2023-01-18T17:21:22","modified_gmt":"2023-01-18T17:21:22","slug":"internet-connection-status","status":"publish","type":"post","link":"https:\/\/learnmobiledevelopment.com\/index.php\/2022\/11\/20\/internet-connection-status\/","title":{"rendered":"How to check internet connection continuously in Xamarin Forms"},"content":{"rendered":"\n<p>Handling the internet connection in any applications is a must if those applications interact with the network and we also must notify the user that he\/she is disconnected from the internet. So In this article, I\u2019m going to show you how to check internet connection continuously in Xamarin Forms from a single place.<\/p>\n\n\n\n<p style=\"font-size:25px\"><strong>Let\u2019s Start<\/strong><\/p>\n\n\n\n<p>In this sample demo I will use <strong>Xamarin.Essentials.Connectivity.cs<\/strong> static class for handling internet connection changes. <\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>1 &#8211; Install Xamarin.Essentials nuget package.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials-1024x563.png\" alt=\"Xamarin Essentials\" class=\"wp-image-527\" srcset=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials-1024x563.png 1024w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials-300x165.png 300w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials-768x422.png 768w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials-1536x844.png 1536w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials-850x467.png 850w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/XamarinEssentials.png 1736w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>2 &#8211; In Android project <\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>2.1  Initialize Xamarin Essentials in OnCreate() method<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected override void OnCreate(Bundle savedInstanceState)\n{\n     base.OnCreate(savedInstanceState);\n\n     \/\/ Initializing Xamarin Essentials\n     Xamarin.Essentials.Platform.Init(this, savedInstanceState);\n\n     global::Xamarin.Forms.Forms.Init(this, savedInstanceState);\n     LoadApplication(new App());\n}<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>2.2 Add <em>ACCESS_NETWORK_STATE<\/em> permission in manifest file<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n\tandroid:versionCode=\"1\"\n\tandroid:versionName=\"1.0\"\n\tpackage=\"com.companyname.xfinternetstatussample\">\n\t&lt;uses-sdk android:minSdkVersion=\"21\" android:targetSdkVersion=\"31\" \/>\n\t&lt;application android:label=\"XFInternetStatusSample.Android\" android:theme=\"@style\/MainTheme\">&lt;\/application>\n\t&lt;uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" \/>\n&lt;\/manifest><\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>3 &#8211; Create a NetworkConnectivity.cs class for handling network connections<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">using Xamarin.Essentials;\n\nnamespace XFInternetStatusSample\n{\n    public class NetworkConnectivity\n    {\n        private bool IsInternetConnected;\n\n        #region Constructor\n\n        public NetworkConnectivity()\n        {\n            \/\/ Register for connectivity changes, be sure to unsubscribe when finished\n            Connectivity.ConnectivityChanged += OnConnectivityChanged;\n\n            IsInternetConnected = CheckConnection();\n        }\n\n        #endregion\n\n        #region Destructor\n\n        ~NetworkConnectivity()\n        {\n            Connectivity.ConnectivityChanged -= OnConnectivityChanged;\n        }\n\n        #endregion\n\n        #region Handle Network Connection \n\n        public static bool CheckConnection()\n        {\n            var current = Connectivity.NetworkAccess;\n\n            if (current == NetworkAccess.Internet)\n                return true;\n            else\n                return false;\n        }\n\n        private void OnConnectivityChanged(object sender, ConnectivityChangedEventArgs e)\n        {\n            var access = e.NetworkAccess;\n            var profiles = e.ConnectionProfiles;\n\n            switch (access)\n            {\n                case NetworkAccess.Internet:\n\n                    IsInternetConnected = true;\n                    ShowInternetConnection(true);\n\n                    break;\n\n                case NetworkAccess.None:\n\n                    IsInternetConnected = false;\n                    ShowInternetConnection(false);\n\n                    break;\n\n                case NetworkAccess.Local:\n\n                    IsInternetConnected = false;\n                    ShowInternetConnection(false);\n\n                    break;\n\n                case NetworkAccess.Unknown:\n                    System.Console.Write(\"A problem has occurred with your network connection.\");\n                    break;\n                default:\n                    break;\n            }\n        }\n\n        private void ShowInternetConnection(bool isInternetAvail)\n        {\n            \/\/ Set Internet connection view in every page in header\n            App.Instance.SetInternetConnectionView(isInternetAvail);\n        }\n\n\n        #endregion\n\n    }\n}<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>4 &#8211; Now, Create Instance static property in App.xaml.cs<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">private static App _instance;\npublic static App Instance \n{\n    get { return _instance; }\n    set { _instance = value; }\n}\n<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>5 &#8211; Initialize Instance static variable in constructor of App.xaml.cs<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public App ()\n{\n    InitializeComponent();\n    Instance = this;\n    MainPage = new NavigationPage(new MainPage());\n}\n<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>6 &#8211; Now, Initialize \u200b\u200bNetworkConnectivity.cs class in OnStart() method.<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected override void OnStart ()\n{\n    \/\/ Register Network Connectivity Change Event\n    NetworkConnectivity networkConnectivityHelper = new NetworkConnectivity();\n}<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>7 &#8211; Now, Coming to UI part first of all we need to create ControlTemplate for each network state in App.xaml<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetTemplates.png\" alt=\"Internet connection status\" class=\"wp-image-155\" width=\"1134\" height=\"998\" srcset=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetTemplates.png 1134w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetTemplates-300x264.png 300w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetTemplates-1024x901.png 1024w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetTemplates-768x676.png 768w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetTemplates-850x748.png 850w\" sizes=\"auto, (max-width: 1134px) 100vw, 1134px\" \/><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> \n&lt;!--  Page Header (InternetConnection view) Template  -->\n&lt;ControlTemplate x:Key=\"InternetConnTemplate\">\n        &lt;StackLayout Spacing=\"0\">\n                   \n               &lt;BoxView\n                     BackgroundColor=\"#2196F3\"\n                     HeightRequest=\"55\"\n                     IsVisible=\"{OnPlatform Android='False',\n                                               iOS='True'}\" \/>\n\n               &lt;ContentPresenter \/>\n                    \n        &lt;\/StackLayout>\n&lt;\/ControlTemplate>\n\n&lt;!--  Empty Template  -->\n&lt;ControlTemplate x:Key=\"EmptyTemplate\">\n        &lt;StackLayout Spacing=\"0\">\n\n               &lt;BoxView\n                    BackgroundColor=\"#2196F3\"\n                    HeightRequest=\"55\"\n                    IsVisible=\"{OnPlatform Android='False',\n                                               iOS='True'}\" \/>\n\n               &lt;ContentPresenter \/>\n\n        &lt;\/StackLayout>\n&lt;\/ControlTemplate>\n\n &lt;!--  Online Template  -->\n &lt;ControlTemplate x:Key=\"OnlineTemplate\">\n         &lt;StackLayout Spacing=\"0\">\n\n               &lt;BoxView\n                    BackgroundColor=\"#2196F3\"\n                    HeightRequest=\"55\"\n                    IsVisible=\"{OnPlatform Android='False',\n                                               iOS='True'}\" \/>\n\n               &lt;Frame\n                    x:Name=\"FrameBackground\"\n                    Padding=\"0,2,0,2\"\n                    BackgroundColor=\"#32CD32\"\n                    CornerRadius=\"0\"\n                    HasShadow=\"False\">\n\n                      &lt;Label\n                          x:Name=\"LabelTitle\"\n                          FontAttributes=\"Bold\"\n                          HorizontalOptions=\"CenterAndExpand\"\n                          Text=\"Internet Connected\"\n                          TextColor=\"White\"\n                          VerticalOptions=\"CenterAndExpand\" \/>\n\n               &lt;\/Frame>\n\n               &lt;ContentPresenter \/>\n\n         &lt;\/StackLayout>\n&lt;\/ControlTemplate>\n\n&lt;!--  Offline Template  -->\n&lt;ControlTemplate x:Key=\"OfflineTemplate\">\n        &lt;StackLayout Spacing=\"0\">\n\n              &lt;BoxView\n                   BackgroundColor=\"#2196F3\"\n                   HeightRequest=\"55\"\n                   IsVisible=\"{OnPlatform Android='False',\n                                               iOS='True'}\" \/>\n\n              &lt;Frame\n                   Padding=\"0,2,0,2\"\n                   BackgroundColor=\"Red\"\n                   CornerRadius=\"0\"\n                   HasShadow=\"False\">\n\n                       &lt;Label\n                            FontAttributes=\"Bold\"\n                            HorizontalOptions=\"CenterAndExpand\"\n                            Text=\"No internet connection\"\n                            TextColor=\"White\"\n                            VerticalOptions=\"CenterAndExpand\" \/>\n\n              &lt;\/Frame>\n\n              &lt;ContentPresenter \/>\n\n         &lt;\/StackLayout>\n&lt;\/ControlTemplate>\n<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>8 &#8211; Now, We will need to change the template at run time when the network state will change<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>So, Create a <strong>SetInternetConnectionView()<\/strong> method in <strong>App.xaml.cs<\/strong>&nbsp;If you will see, this method is called from the <strong>NetworkConnectivity.cs<\/strong> class.<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#region Set Internet Connection View\n\npublic void SetInternetConnectionView(bool isInternetAvail)\n{\n     Device.BeginInvokeOnMainThread(() =>\n     {\n         if (isInternetAvail)\n         {\n              App.Current.Resources[\"InternetConnTemplate\"] = App.Current.Resources[\"OnlineTemplate\"];\n\n              StartTimerFor4Second();\n         }\n         else\n         {\n              App.Current.Resources[\"InternetConnTemplate\"] = App.Current.Resources[\"OfflineTemplate\"];\n         }\n     });\n}\n\nprivate static void RemoveTopInternetConnView()\n{\n    App.Current.Resources[\"InternetConnTemplate\"] = App.Current.Resources[\"EmptyTemplate\"];\n}\n\nprivate void StartTimerFor4Second()\n{\n    System.Timers.Timer timer = new System.Timers.Timer();\n    timer.Interval = 4000;\n    timer.Enabled = true;\n    timer.Elapsed += OnTimedEvent;\n}\n\nprivate static void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)\n{\n    try\n    {\n         (source as System.Timers.Timer).Enabled = false;\n         (source as System.Timers.Timer).Dispose();\n\n         Device.BeginInvokeOnMainThread(() =>\n         {\n             RemoveTopInternetConnView();\n         });\n    }\n    catch (Exception ex)\n    {\n    }\n}\n\n#endregion\n<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>State Explanation<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Normal State<\/strong> : Empty Template shows in normal state.<br><strong>Offline State<\/strong> : Offline Template shows when no internet connection is available.<br><strong>Online State<\/strong> : Online Template shows when internet connection comes back.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>I have used a timer for displaying online templates for only 4 seconds.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In case of no internet connection we will need to call the <strong>SetInternetConnectionView() <\/strong>method from the <strong>OnResume() <\/strong>method and <strong>Constructors <\/strong>of<strong> App.xaml.cs.<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">protected override void OnResume ()\n{\n     if (!NetworkConnectivity.CheckConnection())\n         SetInternetConnectionView(false);\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public App ()\n{\n     InitializeComponent();\n     Instance = this;\n     MainPage = new NavigationPage(new MainPage());\n\n     if (!NetworkConnectivity.CheckConnection())\n          SetInternetConnectionView(false);\n}<\/pre>\n\n\n\n<p class=\"has-medium-font-size\"><strong>9 &#8211; At last we need to set the InternetConnTemplate control template in the root page of all pages<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>ControlTemplate=&#8221;{DynamicResource InternetConnTemplate}&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Example<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"652\" src=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetStatusControlTemplate.png\" alt=\"Internet connection status\" class=\"wp-image-166\" srcset=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetStatusControlTemplate.png 1348w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetStatusControlTemplate-300x145.png 300w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetStatusControlTemplate-1024x495.png 1024w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetStatusControlTemplate-768x371.png 768w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/InternetStatusControlTemplate-850x411.png 850w\" sizes=\"auto, (max-width: 1348px) 100vw, 1348px\" \/><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>10 &#8211; Result<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1566\" style=\"aspect-ratio: 738 \/ 1566;\" width=\"738\" controls muted src=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/InternetStatus.mov\"><\/video><\/figure>\n\n\n\n<p>That\u2019s all for now!<\/p>\n\n\n\n<p>You can check the full source code <a href=\"https:\/\/github.com\/Alam-Ashraf\/XFInternetStatusSample\" target=\"_blank\" rel=\"noopener\" title=\"\">here<\/a><strong>.<\/strong><\/p>\n\n\n\n<p>Happy Coding!<strong> \ud83d\ude00<\/strong><\/p>\n\n\n\n<div style=\"height:35px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"has-medium-font-size\"><strong>You may also like<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group is-content-justification-space-between is-nowrap is-layout-flex wp-container-core-group-is-layout-0dfbf163 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-4b2eccd6 wp-block-group-is-layout-flex\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/learnmobiledevelopment.com\/index.php\/2022\/11\/20\/rotate-views-on-orientation-change\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/ScreenBothRotation-1024x576.png\" alt=\"Rotate views on orientation change\" class=\"wp-image-181\" width=\"512\" height=\"288\" srcset=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/ScreenBothRotation-1024x576.png 1024w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/ScreenBothRotation-300x169.png 300w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/ScreenBothRotation-768x432.png 768w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/ScreenBothRotation-850x478.png 850w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/11\/ScreenBothRotation.png 1224w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\">How to rotate views on orientation change in Xamarin Forms<\/p>\n<\/div>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-4b2eccd6 wp-block-group-is-layout-flex\">\n<div class=\"wp-block-group is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-4b2eccd6 wp-block-group-is-layout-flex\"><div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/learnmobiledevelopment.com\/index.php\/2022\/12\/07\/docklayout-in-maui\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/DockLayoutInMAUI-1024x589.png\" alt=\"DockLayout in MAUI\" class=\"wp-image-445\" width=\"512\" height=\"295\" srcset=\"https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/DockLayoutInMAUI-1024x589.png 1024w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/DockLayoutInMAUI-300x172.png 300w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/DockLayoutInMAUI-768x442.png 768w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/DockLayoutInMAUI-850x489.png 850w, https:\/\/learnmobiledevelopment.com\/wp-content\/uploads\/2022\/12\/DockLayoutInMAUI.png 1294w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\">How to use DockLayout in MAUI<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Handling the internet connection in any applications is a must if those applications interact with the network and we also must notify the user that he\/she is disconnected from the internet. So In this article, I\u2019m going to show you how to check internet connection continuously in Xamarin Forms from a single place. Let\u2019s Start&#8230;<\/p>\n","protected":false},"author":1,"featured_media":169,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[6,7],"class_list":["post-119","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xamarin","tag-internet-connection-status","tag-show-internet-connection-status"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":64,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":769,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/posts\/119\/revisions\/769"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/media\/169"}],"wp:attachment":[{"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnmobiledevelopment.com\/index.php\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}