- Create an app using the "Blank App (Android) F#" template in Visual Studio 2019
- Try to add Xamarin Forms

- Xamarin Forms cannot be added?

What happened? How can I add Xamarin Forms into an F# Xamarin Android project?


What happened? How can I add Xamarin Forms into an F# Xamarin Android project?
I think you should consider Xamarin.Forms Embedding.
It enables a Xamarin.Forms' ContentPage to be incorporated into a Xamarin.IOS or Xamarin.Android app.
I have used it before and it had a significant performance cost to it when loading the content page.
Here's the Android documentation.
public class MainActivity : AppCompatActivity
{
public static string FolderPath { get; private set; }
public static MainActivity Instance;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Forms.Init(this, bundle);
Instance = this;
SetContentView(Resource.Layout.Main);
...
Android.Support.V4.App.Fragment mainPage = new NotesPage().CreateSupportFragment(this);
SupportFragmentManager
.BeginTransaction()
.Replace(Resource.Id.fragment_frame_layout, mainPage)
.Commit();
...
}
...
}