Setting up Xamarin Android in windows 8.1 for Visual Studio 13:
First log in to xamarin and download the xamarin android for visual studio from your dashboard. I recommend downloading the offline standalone version. Next install it and open visual studio 13.
It may seem like nothing happened. If you go to project creation in c# as shown below you’ll see there are new options such as android, ios etc. To Create a new android project go to,
File -> New -> Project -> Installed -> Visual C# -> Android -> Blank App ( Or, your preference ) .
In case your android SDK and NDK location wasn’t automatically detected if you try to create a project then you’ll get an error like “value can not be null“. See below to fix that error and continue setting up.
Setting up the SDK and NDK:
Setting up NDK is optional but it is recommend. If your SDK or NDK wasn’t detected automatically then follow the procedure below to set up the SDK and NDK.
Here I have shown setting up the NDK, it is the same procedure as setting up the SDK. Go to,
Tools -> Options -> Xamarin -> Android Settings
Now click on SDK and locate the folder named “sdk” using the pop up explorer. Similarly locate the NDK.
In case you set up the SDK using the procedure above but don’t set up the NDK then you will be shown a message like this below. This doesn’t affect the ability to run the app but it is recommended. Download the 64-bit version NDK from here.
Creating New Xaramrin C# Android Project:
Enable Xamarin subscription:
Now that all required tools are setup create a test project. After the project is created you’re shown two tabs getting started and welcome to xamarin. On the welcome to xamarin tab click on login.
Next you’ll be shown a login window. Using your xamarin username and password login to xamarin. You’ll be shown a screen like this below. Now your subscription is activated.
Go to xamarin dashboard, in the computers option you’ll your computer name is added.
Running the Xamarin C# App:
Here I’ve used the AVD’s I created in android studio’s from avd manager. Please follow this tutorial about using running android emulator and windows phone emulator both in the same machine.
Make sure HAXM is downloaded via SDK manager and installed from file explorer. If you have multiple AVD’s you can run on any one of them. But if you have ARM, x86, x86_64 versions then please run x86, x86_64 as they make use of Haxm. So your emulator will start very fast. But if you use ARM version it may take 1 billion years to start.
Errors / Problems:
If there are any errors such as a component is out of date. Then open android sdk manager and update to latest tools.
Running the App in XAP(Xamarin Android Player):
First download a device shown in the XAP. Then follow the procedures below to run the app in your device of choice.
[TODO] Running app using XAP instead of android emulator.