In this article, we learn how to get started with Xamarin.Forms to create a native mobile application for all major platforms.
Create a Xamarin.Forms Project with Portable Class Library (PCL).
Go to File > New Project > Visual C# > Cross -Platform > Blank App (Xamarin.Forms Portable) > Name it “HelloXamarin” and Click OK.
Note: Make Sure install all the required tools i.e. Xamarin for Visual Studio and all other Android SDKs too.
When the project is fully created or loaded then you will see something like this in Solution Explorer.
Here, we can see different projects for each platform i.e. Android, iOS, UWP (Universal Windows Platform), Windows 8.1 and Windows Phone 8.1.
And Portable is the Class library where we write all our common code base for all the platforms.
Inside the Portable Class Library Projects, in App.cs we can see default code which is ready to run.
Now let’s run this default project. You can run the Android project in the android emulator or Windows Project in Windows devices. For iOS you need MacBook. So I am going to run in my Windows Phone Device.
Right Click on the Windows Phone 8.1 project and set it as the startup project.
Run the Project and you will see the output as following in your device. This output is same for all platforms.
Thanks, Happy Coding!