I'm new to Xamarin and made two interfaces for Android and iOS. I have one Core project and put references in the Android and iOS project to the Core project.
How can I use code from my Core project in my iOS/Android project?
For example, this is my Core class TestClass.cs:
using System;
using System.Threading.Tasks;
namespace FindMyRide.Core
{
public class TestClass
{
public string TestString { get; set; }
public TestClass ()
{
TestString = "Hallo";
}
}
}
How can I display the TestString in my iOS or Android application?
I don't know if this is the correct use of shared coding in Xamarin, as I said I'm very new to this and to C#.
You could either build a PCL or build platform specific libraries with code sharing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With