Category: xamarin

Xamarin Forms – check if phone is currently connected to Internet or not

Sometimes, you may need to check if your application has internet connection or not. In order to do so, you can use the plugin https://www.nuget.org/packages/Xam.Plugin.Connectivity/ and then using the following method: public async Task HasInternet() {     var canReach = await CrossConnectivity.Current.IsRemoteReachable(“google.com”);     return canReach; }


Remove Entry suggestion from Xaml file xamarin forms

Extract java library .jar or .aar using command line

Sometimes, you want to extract .jar or .aar file to see the classes or to add into your project. Following are steps to do 1- With .jar Open terminal console jar xf <your_jar>.jar You then will see the extract files / folders created 2- With .aar .aar is a compressed file. You can do as …


Handle back button on hardware navigation bar Android – xamarin forms

This post is for mobile development using Xamarin Forms. Sometimes, instead of using default effect of back press button, you want to fire an event when user clicks into that back button so that you can handle it. Unfortunately, we do not have the method onBackPressed() method in Xamarin Forms. However, you can achieve this …


c# – run a code after a time delay

Sometimes, you will need to execute a piece of code after a time delay. To achieve this behaviour, we can have following 2 solutions: Solution 1: – We can use dependency service to implement a native function of delay for each platform (like delay Runnable for Android) Solution 2: – If you want a cross …