Xamarin Android Finalizer not getting called when leaving the activity to go to another Activity

This is actually remarkably complicated; the short answer, regarding the activity still being alive, is yes and no. Providing you have cleaned up the resources for your Activity correctly, your activity will be cleaned up (eventually) by the garbage collector. Regarding cleanup, it’s import to know that Xamarin discourages (slide 44 onwards) using finalizers. Here’s … Read more

Xamarin Android issue connecting via HTTPS to site with self-signed certificate: “Trust anchor for certification path not found.”

I was able to get this to work in both Android and iOS. iOS was easy, just override ServicePointManager.ServerCertificateValidationCallback: ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; For Android I used Bruno Caceiro’s answer from a similar question and a created Dependency Service. In my Xamarin Forms project I added a simple interface: public interface … Read more

Xamarin : Android : System.UnauthorizedAccessException: Access to the path is denied

First of all add this permissions to you Manifest: <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> Since Android 6.0 (API 23) you need also to request the permissions manually, add this code on your MainActivity.cs on your Xamarin.Android project: if ((ContextCompat.CheckSelfPermission(this, Manifest.Permission.WriteExternalStorage) != (int)Permission.Granted) || (ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) != (int)Permission.Granted)) { ActivityCompat.RequestPermissions(this, new string[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage … Read more

MVVMCross support for Xamarin.iOS Storyboards

There is at least one sample published showing the use of Storyboards – the rather oddly named eh – https://github.com/slodge/eh This sample worked by: letting the Storyboard control the navigation using MvxViewController as a VC base class (in place of UIViewController) manually setting the ViewModel in one case – by setting it directly before calling … Read more

Xamarin Forms Swipe Left/Swipe Right Gestures

No need third party libraries.. No need to pay.. Just add these two classes & Implement your swipe listeners Step 1: Copy paste these two classes SwipeListener.cs using System; using Xamarin.Forms; namespace SwipeLib { public class SwipeListener : PanGestureRecognizer { private ISwipeCallBack mISwipeCallback; private double translatedX = 0, translatedY = 0; public SwipeListener(View view, ISwipeCallBack … Read more