1
votes
  1. Create an app using the "Blank App (Android) F#" template in Visual Studio 2019
  2. Try to add Xamarin Forms try
  3. Xamarin Forms cannot be added? enter image description here

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

2
I think you do not understand how Xamarin.Android, Xamarin.iOS and Xamarin.Forms work please take a look at this applikeysolutions.com/blog/… - FreakyAli
A Xamarin.Forms F# template doesn't exist. I'm trying to recreate one. - Happypig375
Not exactly what you asked for, but you should definitely look at fsprojects.github.io/Fabulous if you want to to Xamarin.Forms with F#. - rmunn
I'm debugging Fabulous itself; I can't use it directly. github.com/fsprojects/Fabulous/issues/385 - Happypig375

2 Answers

0
votes

First of all, you cannot add the xamarin forms nuget packages to you xamarin native project.

The right process is you can create a xamarin forms project, then you can add the xamarin forms package in the xamarin android platform like this screenshot.

enter image description here

0
votes

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();
        ...
    }
    ...
}