Creating the Android project
Create a new Blank Android project into the solution (do not select the Android XAML App template) and name it as
MvvmCrossDemo.Droid, like this:
Pay attention on the different project templates. There are a couple of different templates here. Notice that we need the Android App (Xamarin), not the Android XAML App (Xamarin.Forms). I will describe
Xamarin.Formsin the next sections, but not now.
The default Android target version is Android 8.1 (Oreo). If you need to edit it, right click the
MvvmCrossDemo.Droidproject and select Properties, then choose Application Tab, and update the Target Framework like this:
MainActivity.csin the root folder and the
Main.axmlin the resource/Layout folder. We do not need them.
Then install the
MvvmCrosspackage like we did in the
MvvmCrossDemo.Coreproject. We also need to add the reference to the
MvvmCrossDemo.Coreproject. You might encounter an error that is:
You need to add a reference to Mono.Android.Export.Dll when you use ExportAttribute or ExportFieldAttribute.
To fix it, we need to add the reference to
Mono.Android.Exportby Reference Manager: