Setting up Xamarin for Android Development in Visual Studio 2013 Ultimate Windows 8.1

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.

 

Downloading Xamarin offline Standalone 1
Downloading Xamarin offline Standalone 1
Downloading Xamarin offline Standalone 2
Downloading Xamarin offline Standalone 2

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 ) .


 

Project Creation:

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.

Setting up SDk and NDK part 1
Setting up SDK and NDK part 1
Setting up SDk and NDK part 2
Setting up SDK and NDK part 2
Setting up SDK and NDK part 3
Setting up SDK and NDK part 3
Setting up SDK and NDK part 4
Setting up SDK and NDK part 4

 

NDK Warning:

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.

NDK warning message part 1
NDK warning message part 1

 

Creating New Xaramrin C# Android Project:

Creating Xamarin Andoid Project Part 1
Creating Xamarin android Project Part 1
Creating Xamarin Andoid Project Part 2
Creating Xamarin android Project Part 2

 

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.

visual studio xamarin login
visual studio xamarin login
visual studio xamarin subscription activation
visual studio xamarin subscription activation
visual studio xamarin registered computers
visual studio xamarin registered computers

 

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.

Visual Studio AVD Manager
Visual Studio AVD Manager
Running AVD in visual studio
Running AVD in visual studio
Starting Android Virtual Device
Starting Android Virtual Device
Running xamarin app in android emulator
Running xamarin app in android emulator

 

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.

SDK tools out of date error
SDK tools out of date error
SDK tools out of date error fix
SDK tools out of date error fix

 

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.

Xamarin Android Player
Xamarin Android Player

[TODO] Running app using XAP instead of android emulator.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s