Saturday, December 20, 2014

Introduction to Xamarin and how to use it with Visual Studio 2013 to develop cross-platform apps

Xamarin platform helps you write your apps entirely in C# and share the same code on iOS, Android, Windows, Mac. Basically you will take advantage of native iOS and Android apps in C# by using Visual Studio for iOS, Android, and Windows development. You will build fully native user interface with cross-platform components and pre-built apps (Nugets library). So where to start?

1. Download Xamarin for Windows: Download Xamarin (http://xamarin.com/download) and run it as an administrator! The installer will download the Android SDK, Java 1.7 JDK (you might have to install the "32" bit version separately yourself), Xamarin for Visual Studio, and Xamarin SDK.

2. Download Xamarin for OS X  (http://xamarin.com/download) and install it.

3. Open a new project in Visual Studio, under "Visual C#", go to "iOS", "Classic API", "iPhone", and select "Single View App (iPhone Classic API)"

4.You'll be prompted to install Xamarin.iOS on your Mac. You will have to open Xamarin.iOS Build Host application (type "xamarin build host" into Spotlight) on your Mac, then click "Pair".

5. Assuming, you already have a license (even with a trial version), you should be able to get the code from your Mac and enter the code to your Windows. Once you pair with a machine, you won't have to do it again.

6. On your Windows machine, you could pick iPhone, or iPhone simulator, go to MainStoryboard.storyboard. Add some buttons, create some events, pop some alerts to get a feeling how it works.

No comments:

Post a Comment