In this article, we learn how to get started with Xamarin.Forms to create a native mobile application for all major platforms.

Step 1:

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.

C:\Users\Kishor Bikram Oli\Desktop\Blogs\20160528\1.JPG

Step 2:

When the project is fully created or loaded then you will see something like this in Solution Explorer.

C:\Users\Kishor Bikram Oli\Desktop\Blogs\20160528\2.JPG

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.

Step 3:

Inside the Portable Class Library Projects, in App.cs we can see default code which is ready to run.

C:\Users\Kishor Bikram Oli\Desktop\Blogs\20160528\3.JPG

Step 4:

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.

C:\Users\Kishor Bikram Oli\Desktop\Blogs\20160528\4.png

Step 5:

Run the Project and you will see the output as following in your device. This output is same for all platforms.

C:\Users\Kishor Bikram Oli\Desktop\Blogs\20160528\wp_ss_20160528_0001.png

That’s it.

Thanks, Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">