Click here to Skip to main content
15,881,092 members
Articles / Mobile Apps / Xamarin
Tip/Trick

Android on Visual Studio

Rate me:
Please Sign up or sign in to vote.
3.53/5 (29 votes)
18 Mar 2015CPOL2 min read 68.2K   34   13
Develop Android applications using Visual Studio and C#

1. Xamarin Project

Xamarin is a project for building cross-platform applications. What is really nice is that it uses C# and Visual Studio 2013, the perfect combination for most .NET developers! It is now possible to use Visual Studio to build applications for Android and iOS. In fact, Xamarin has its own IDE, which is Xamarin Studio. And, it could be installed in Visual Studio as an extension to benefit from all of its powerful tools.

2. Download Xamarin

A 1 month trial version is available for download. MSDN subscribers have a better chance to try the full version for 30 days.

A good news has come out on March 19th, there will be a free version for open source projects contributors where you may apply here.

3. Getting Started

To create an Android application in Visual Studio, select New Project -> Android, then chose the API version you want. Choosing “Android application” will create a project targeting API level 10. It’s possible to download and install other SDK levels.

The created project seems to be an ordinary Android project, except that the Activity object is now a C# class and project references to .NET and Mono libraries.

The design of the UI could be done with Drag and Drop. The Toolbox window contains almost all common Android controls. The Properties window contains all selected controls’ properties.

Image 1

Figure shows editing Android UI with Visual Studio 2013

4. Advantages of Xamarin

In addition to using Visual Studio features like IntelliSense, Nuget, Code Map, it’s also possible to use Portable Class Library (PCL) to target multiple platforms including iOS and Android. Also, Nuget makes it easy to install useful packages as Json.net, HTTP Client Libraries or even Sqlite.net.

Xamarin provides access to each platform specific features to benefit from a native experience, which is not possible with HTML5.

5. Conclusion

.NET developers got the advantage to start developing Android and iOS applications using their skills with C# and Visual Studio, with no need to learn two new languages. To go further, well documented tutorials are available on docs.xamarin.com.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
Tunisia Tunisia
I'm a Software Engineer and MVP (Client Development). I like writing articles and developing open source software in C#, Windows Phone and Windows 8 applications droidcon.tn/speakers.php.
http://houssemdellai.net

Comments and Discussions

 
QuestionMSDN Trial is also 30 days Pin
Chinatablet21-Mar-15 4:23
professionalChinatablet21-Mar-15 4:23 
AnswerRe: MSDN Trial is also 30 days Pin
Houssem_Dellai22-Mar-15 9:46
Houssem_Dellai22-Mar-15 9:46 
QuestionNeed some details Pin
ankur4747@yahoo.com21-Mar-15 2:04
ankur4747@yahoo.com21-Mar-15 2:04 
AnswerRe: Need some details Pin
Houssem_Dellai22-Mar-15 9:41
Houssem_Dellai22-Mar-15 9:41 
GeneralMy vote of 5 Pin
Humayun Kabir Mamun18-Mar-15 19:54
Humayun Kabir Mamun18-Mar-15 19:54 
GeneralAndroid on Visual Studio Pin
Member 1090680826-Jun-14 16:55
professionalMember 1090680826-Jun-14 16:55 
QuestionGood choice Pin
suriporn24-Jun-14 6:15
suriporn24-Jun-14 6:15 
GeneralGood Pin
mathiazhagan0123-Jun-14 3:07
mathiazhagan0123-Jun-14 3:07 
GeneralRe: Good Pin
Houssem_Dellai23-Mar-15 1:43
Houssem_Dellai23-Mar-15 1:43 
GeneralMy vote of 5 Pin
Bill SerGio, The Infomercial King23-Jun-14 1:35
Bill SerGio, The Infomercial King23-Jun-14 1:35 
GeneralMy vote of 5 Pin
Humayun Kabir Mamun22-Jun-14 21:03
Humayun Kabir Mamun22-Jun-14 21:03 
SuggestionRe: Just a point Pin
Heriberto Lugo22-Jun-14 9:53
Heriberto Lugo22-Jun-14 9:53 
GeneralRe: Just a point Pin
bryce22-Jun-14 11:41
bryce22-Jun-14 11:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.