The Xamarin product range covers iOS, OS X, and Android development. This enables the .NET Framework development on devices that do not natively support it via the respected and mature Mono framework.
In this chapter we will cover the following topics:
Installing Xamarin.iOS, Xamarin.Android, and Xamarin Studio
Setting up a Windows machine to develop apps for iOS
Installing Xamarin for Windows and OS X is a very similar and simple process. Before you download, you will need to ensure that your computer has the following requirements as the minimum specifications:
For both, the general rule is the more memory you have the better. You also need to have a live network connection.
You will need to give Xamarin some basic information before you are allowed to download the evaluation copy. The evaluation will allow you to develop and deploy apps for 30 days, after which you will need to purchase a copy. If you have placed any apps on the Apple store or Google Play, they will no longer function.
Depending on your network connection, this can take anywhere up to an hour as each package is downloaded in turns and then installed. The installation process is automatic, and anything required for the software to work is installed with the exception of Xcodeâit is simple to check whether you have this installed on your Mac: click on the
Applications directory and look near the bottom for the icon. If it's not there, go to the App Store and type in
Xcode. The download is free. Unless you have a reason to change the defaults, accept the default setup options by clicking on Next each time an option is presented.
Then the firewall will need to be switched off. While this is not normally a good idea, a majority of internal networks have a sufficiently good firewall at any router. If you are not happy with this, leave the settingâyou just won't be able to run or develop for iOS under Windows.
When Xamarin.iOS for Visual Studio is installed, it also installs a small listener service called Bonjour. When you try to create an iOS application, Bonjour will attempt to automatically find a Mac on your network. This may fail, and if it does you will see the following screenshot:
In this example, the IP address from the Mac on my network has the address shown in the preceding screenshot. When you click on OK, Bonjour will attempt to attach to Mac. If it is successful, you will be presented with the following screenshot:
As soon as you see the window shown in the preceding screenshot on your screen, you are nearly there. The next step is to click on the host machine (highlighted in the preceding screenshot) and click on Connect. Once done, you're set up on the PC to develop for iOS under Windows.
If the Bonjour service was unable to automatically determine the Mac, you may need to manually set up the service. This can be performed very easily.
Click on the Start button and select Control Panel.
On the Control Panel, click on Administrative Tools and from there select Services. You will be presented with a window, as shown in the following screenshot:
When Xamarin.Android is installed on either platform, the compiler and the minimal set of the Android Software Developers Kit (SDK) is installed. This will let you get going with the development but not allow you to target a range of devices. It is, therefore, important to install the SDK for other versions of the Android operating system. This is preformed using the Android SDK Manager.
To access SDK Manager on a PC, select Start and on the All Programs menu there is a menu option called Android SDK Tools under which is the Android SDK Manager. Select the SDK Manager and you will be presented with a new window that allows you to select the SDK you want.
A part of the installation process on a Mac installs the Xamarin IDE (Integrated Development Environment)âXamarin Studio. This is similar in many ways to Visual Studio and performs a very similar job.
To access the SDK Manager on Xamarin Studio, select Tools followed by Open Android SDK Manager.
In both cases, you will be presented with the following screenshot from the SDK Manager. It is simplest to select all the SDKs and click on the Install packages... button to start the process. Depending on your network connection speed, this process may take a while.