How can I use MS Visual Studio for Android Development?

AndroidVisual Studio

Android Problem Overview


Can you use Visual Studio for Android Development?

If so how would you set the android SDK instead of .NET framework and are there any special settings or configuration?

Android Solutions


Solution 1 - Android

Yes, you can use Visual Studio for Android (native) using "vs-android".

Here are the steps to set it up:

  1. Download the Android SDK here.

  2. Download the Android NDK here.

  3. Download Cygwin here.

  4. Download the JDK here.

  5. Download Visual Studio 2010, 2012 or 2013 here.

  6. Download vs-android here.

  7. Download Apache Ant here.

  8. Set environment variables:

(Control Panel > System > Advanced > Environment Variables)

ANDROID_HOME = <install_path>\android-sdk
ANDROID_NDK_ROOT = <install_path>\android-ndk
ANT_HOME  = <install_path>\apache-ant
JAVA_HOME = <install_path>\jdk
_JAVA_OPTIONS = -Xms256m -Xmx512m  

9. Download examples from here.

It works like a charm... and best so far to use.

Solution 2 - Android

Yes you can:

http://www.gavpugh.com/2011/02/04/vs-android-developing-for-android-in-visual-studio/

enter image description here

In case you get "Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\jre6\lib\tools.jar" you can add an environment variable JAVA_HOME that points to your Java JDK path, for example c:\sdks\glassfish3\jdk (restart MSVC afterwards)

An even better solution is using WinGDB Mobile Edition in Visual Studio: it lets you create and debug Android projects all inside Visual Studio:

http://ian-ni-lewis.blogspot.com/2011/01/its-like-coming-home-again.html

Download WinGDC for Android from http://www.wingdb.com/wgMobileEdition.htm

Solution 3 - Android

Believe me, I've tried so hard to find a decent IDE for Android developement but I failed. I used Visual Studio for many years, and it is so hard for me to get use to the way Eclipse doing things.

However, the new IntelliJ supports for Android development, it's the closest you can get.

Solution 4 - Android

If you're interested in producing HTML5 hybrid applications (web apps wrapped in a native container giving access to device functions), the http://www.vsnomad.com">Nomad Visual Studio extension supports building for android devices.

Solution 5 - Android

From the Android documentation:

The recommended way to develop an Android application is to use Eclipse with the ADT plugin... However, if you'd rather develop your application in another IDE, such as IntelliJ, or in a basic editor, such as Emacs, you can do that instead.

Currently, there are plug-ins for IntelliJ IDEA and NetBeans, but you can still use the tools in /tools to build, debug, monitor, measure and start the emulator.

Solution 6 - Android

Much has changed since this question was asked. Visual Studio 2013 with update 4 and Visual Studio 2015 now have integrated tools for Apache Cordova and you can run them on a Visual Studio emulator for Android.

Solution 7 - Android

Microsoft Visual Studio 2015 now has options for Android development: C++, Cordova, and C# with Xamarin. When choosing one of those Android development options, Visual Studio will also install the brand new Visual Studio Emulator for Android to use as a target for debugging your app. You can also download the emulator without needing to install Visual Studio. For more details see

Visuals Studio 2015 https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs

Visual Studio Emulator https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx

Video of features https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2015-Final-Release-Event/Visual-Studio-Emulator-for-Android

Java Extension for Visuals Studio 2012, 2013. 2015 https://visualstudiogallery.msdn.microsoft.com/bc561769-36ff-4a40-9504-e266e8706f93

Solution 8 - Android

That depends on what you actually want to achieve.

You want to keep on making normal Java-based Android application, but use Visual Studio for development? Then it's bad news, as Visual Studio has no built-in java support. Thus, if you use it out-of-the-box, you will lose all Java-specific Eclipse functionality (IntelliSense for Java, Java debugger, wizards, etc) as well as numerous Android plugins (that are Eclipse-specific and won't work with VS).

On the other hand, you can use Mono for Android to develop apps in C# in VS, but they won't look as smooth as the native apps (some functionality might be missing, look-and-feel slightly different, etc.). In that case such app could sell less than a "normal" Java app that looks and feels like all other Java apps.

If you are talking about native Android code (in C/C++), such as games, the news are not as bad. As Visual Studio has no problem with C++, there are numerous ways to make it work:

  1. If you only want to compile your code, you can use the free vs-android toolset. It's essentially a set of build rules telling Visual Studio how to launch Android compiler.

  2. If you want to compile and debug your native code with Visual Studio, you will need something more advanced, such as VisualGDB for Android. It can build/debug your Native code independently, or together with debugging Java code from Eclipse.

Solution 9 - Android

Solution 10 - Android

Besides, you can use VS for Android development too, because in the end, the IDE is nothing but a fancy text editor with shortcuts to command line tools, so most popular IDE's can be used.

However, if you want to develop fully native without restrictions, you'll have all kinds of issues, such as those related to file system case insensitivity and missing libraries on Windows platform..

If you try to build windows mobile apps on Linux platform, you'll have bigger problems than other way around, but still makes most sense to use Linux with Eclipse for Android OS.

Solution 11 - Android

You can use Visual Studio for Android Development. See a nice article on it here

Solution 12 - Android

I suppose you can open Java files in Visual Studio and just use the command line tools directly. I don't think you'd get syntax highlighting or autocompletion though.

Eclipse is really not all that different from Visual Studio, and there are a lot of tools that are designed to make Android development more comfortable that work from within Eclipse.

Solution 13 - Android

If you want to create an Android application using c# language you can use Xamarin.
they created this great Cross Platform development tool which enables developers to develop iOS and Android apps in C# language.

Xamarin is offered in different licenses from free to enterprise levels but for not I will be using the starter version which is the free version. It includes the Xamarin Studio which is great start for those who want to try out creating their first apps for Android, they also offer a Business license which lets you develop in Visual Studio so you can use that rich experience similar to developing Web Apps or Windows Apps, then they have this Enterprise which contains everything

Solution 14 - Android

You can use Visual Studio 2015 to building cross-platform apps for Android, iOS, and Windows.

IDE: https://www.visualstudio.com/en-US/explore/cordova-vs

Hope this will help!

Solution 15 - Android

You can Build rich native apps using C# and Xamarin with 100% of the native APIs exposed to you. Or push maximum performance using C++ with code that could be reused with iOS or Windows.

To follow along you’ll need a copy of Visual Studio, plus the ‘Mobile development with .NET’ workload. You can either enable this feature from first installation of Visual Studio or access it from the ‘Tools -> Get Tools and Features…’ menu item:

Visual Studio Installer

When testing and running your app you have the choice of doing so with either an Android emulator running on your development machine, or by directly connecting to an existing Android device. There’s no right option here and different developers prefer different form factors. If you choose the former option, you’ll need to ensure once you’ve selected the workload that on the right-hand pane (‘Installation details’) the checkboxes for Intel Hardware Accelerated Execution Manager and Google Android Emulator are selected (as seen above).

This article will help you to do basic android application through visual studio. I'll put the link here below down.

https://developer.okta.com/blog/2018/12/27/build-a-basic-android-app-with-xamarin-and-visual-studio

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBurningIceView Question on Stackoverflow
Solution 1 - Androiduser1169079View Answer on Stackoverflow
Solution 2 - AndroidErwin CoumansView Answer on Stackoverflow
Solution 3 - AndroidAlexView Answer on Stackoverflow
Solution 4 - AndroidMark ChevertonView Answer on Stackoverflow
Solution 5 - AndroidDimitar DimitrovView Answer on Stackoverflow
Solution 6 - AndroidscottrudyView Answer on Stackoverflow
Solution 7 - AndroidLee StottView Answer on Stackoverflow
Solution 8 - AndroidIvan ShcherbakovView Answer on Stackoverflow
Solution 9 - Androidfree4rideView Answer on Stackoverflow
Solution 10 - AndroidfipdaView Answer on Stackoverflow
Solution 11 - AndroidyogihostingView Answer on Stackoverflow
Solution 12 - AndroidjoemoeView Answer on Stackoverflow
Solution 13 - AndroidAminMView Answer on Stackoverflow
Solution 14 - AndroidPiseth SokView Answer on Stackoverflow
Solution 15 - AndroidHimesh PereraView Answer on Stackoverflow