Related
So there is this new thing of Microsoft wanna-be React Native
https://learn.microsoft.com/en-us/dotnet/maui/
Right off the bat, I was trying to get it working with Visual Studio 2019.
I was following .NET 6 previews, and the blog posts of David Ortinau (the Principal Program Manager, .NET Multi-platform App UI)
It has been four or five years since I last time had a look at Xamarin, at which point I decided it was a disaster, and gradually moved to React Native as a choice of cross-platform mobile UI.
Visual Studio 2019
But after few hours of wrestling with Hyper V, and Visual Studio installer, I was able to run a simple Xamarin app, on an Android emulator. It was super slow tho, even after switching to Intel HAXM.
At this point, I think it's appropriate to ask: what's the deal with Android Device Manager on Windows vs Visual Studio Emulator for Android? They kinda seem to do the same thing, so it's confusing.
Even though the .NET 6 preview 4 states the support, after hours of wrestling with the maui-check tool, I finally gave up on VS2019, and completely uninstalled it from the system.
Visual Studio 2022
I installed Preview 3 (the latest version atm) and followed the installation guide (https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation) step by step all the way.
Was able to run Xamarin Android app. And open a new MAUI project, but running it got an error message:
It looks like you are using an incompatible JDK. Please install and
configure Microsoft Mobile OpenJDK.
Which I was able to resolve with the help of this advice:
https://developercommunity.visualstudio.com/t/issues-creating-android-emulator/1467306
Unfortunately, that didn't help me much further
Building the solution now required iTunes and Apple Developer account, for hot restart.
Luckily I was able to disable that from the options > xamarin > ios
But I was still unable to build Android target. Editing the raw project file (btw, kudos for the VS team for scraping all the overload), removing didn't help either.
I still got
XamarinShellPackage did not load correctly
And when trying to still run the project:
error MSB4057: The target "Run" does not exist in the project. build
failed
Hours later, I got to the root cause of it, thanks to noticing that the Options > Xamarin didn't even open anymore.
And it was, that installing the new JDK from Oracle had changed the path so that it was only accessible for Xamarin projects, but apparently, MAUI type project is only looking at C:\Program Files\Android\jdk-16.0.2.7-hotspot
So I got the latest version on JDK from Microsoft to the above-mentioned path.
And the MAUI Blazor is working - finally! :)
I am willing to have one single solution for all platform project.
For now, if I use Visual Studio 2019 Windows, then I can have iOS, Android and UWP
And if, I use Visual Studio for MAC, then I can have iOS, Android and MacOS
I am willing to have one common project and share source code via GitHub Repository (obviously private) and then add all 4 platforms into it.
I already had a running project on VS 2019 Windows, and when I shared the Source code using GitHub to VS MAC, after adding MacOS its not working.
I know I am suppose to ask questions related to coding, and I assume this is indirectly related to that only.
Can anyone guide me, how to do that properly. I am using Syncfusion Xamarin.Forms controls as well.
Before I get into the question: I am using visual studio 2015 Community with Xamarin. I have tried the following to rectify this problem:
Complete VS uninstall and reinstall (along with all components of Xamarin and Android SDK.)
Rolled back various updates to Xamarin (including the most recent one)
Ran repair install on visual studio, c++ 2015 redists (x86, and x64)
Scoured Xamarin forums and Xamarin bugzilla for similar issues. While I found some that dealt with similar issues with the designer. None of them described the exact problem I'm having.
Ok, now that's out of the way, here's my issue:
I was happily working my way through a tutorial on Xamarin.android and things were going great. I was also concurrently building my own simple app to practice my new skill and make it meaningful.
Somewhere along the line either the Android SDK manager or the Xamarin updater wanted me to update something so I went ahead and did it. This started giving me some strange behavior, plus my VS Community install hasn't seen much maintenance lately, so I decided to do a full wipe and reinstall. This took quite a long time between Visual Studio and all the Xamarin and Android tools and updates.
Once I was done I started working again, however any time I try to open a layout (.axml) file in the designer, visual studio totally freezes. If I'm fast I can click to the code interface, but it still locks up.
I can add new layouts to the solution, but the project won't see them (they exist in the folder however, and can be opened with notepad++) if I include them, and then try to open them, the same thing happens.
By 'freezes', I can't click anything in VS, even to close the window, I have to force close it from task manager. This is also strange as task manager doesn't show the program as locked up, only using a minimal amount of ram and cpu (as if it was idling normally).
If I let it sit locked up long enough, Windows will prompt me to run VS from a devenv (not exactly sure what this means). When I do this and reproduce the problem (attempt to open a layout file) I get a long log of unintelligible errors. The only hints I found were some references to missing c++ libraries, which doesn't add up as I have run the repair tool for my redistributables several times now.
Has anyone encountered this problem before? And if so how should I fix it? It this totally prevents me from doing anything with Xamarin and is a big turn-off to the product. (this isn't the first breaking bug I've encountered)
Here is all my version info:
Microsoft Visual Studio Community 2015 Version 14.0.25431.01 Update 3
Microsoft .NET Framework Version 4.6.01038
Installed Version: Community
Visual Basic 2015 00322-20000-00000-AA850 Microsoft Visual Basic
2015
Visual C# 2015 00322-20000-00000-AA850 Microsoft Visual C# 2015
Visual C++ 2015 00322-20000-00000-AA850 Microsoft Visual C++ 2015
Windows Phone SDK 8.0 - ENU 00322-20000-00000-AA850 Windows Phone
SDK 8.0 - ENU
Add New File 3.5 The fastest and easiest way to add new files to any
project - including files that start with a dot
ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11107.0 ASP.NET and Web
Tools 2015.1 (Beta8)
ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0 For additional
information, visit
ASP.NET Web Frameworks and Tools 2013 5.2.40314.0 For additional
information, visit
Common Azure Tools 1.8 Provides common services for use by Azure
Mobile Services and Microsoft Azure Tools.
Dummy Text Generator 1.2.12 Easily insert dummy text into the editor
in Visual Studio. Lorem Ipsum and other vocabularies are supported.
GitHub.VisualStudio 1.0 A Visual Studio Extension that brings the
GitHub Flow into Visual Studio.
JavaScript Language Service 2.0 JavaScript Language Service
JavaScript Project System 2.0 JavaScript Project System
Microsoft Azure Mobile Services Tools 1.4 Microsoft Azure Mobile
Services Tools
NuGet Package Manager 3.4.4 NuGet Package Manager in Visual Studio.
For more information about NuGet, visit
Open Command Line 2.1.177 Opens a command line at the root of the
project. Support for all consoles such as CMD, PowerShell, Bash etc.
Provides syntax highlighting, Intellisense and execution of .cmd and
.bat files.
PreEmptive Analytics Visualizer 1.2 Microsoft Visual Studio
extension to visualize aggregated summaries from the PreEmptive
Analytics product.
SQL Server Compact & SQLite Toolbox 4.6.0 SQL Server Compact &
SQLite Toolbox adds scripting, import, export, rename, query execution
and much more to SQL Server Compact & SQLite Data Connections.
SQL Server Data Tools 14.0.60519.0 Microsoft SQL Server Data Tools
TypeScript 1.8.36.0 TypeScript tools for Visual Studio
Visual Studio Tools for Apache Cordova Update 10 Visual Studio Tools
for Apache Cordova
Web Compiler 1.11.319 Compiler for LESS, Sass and CoffeeScript files
Web Essentials 2015.3 3.0.235 Adds many useful features to Visual
Studio for web developers. Requires Visual Studio 2015
Xamarin 4.1.2.18 (fcbe082) Visual Studio extension to enable
development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android 6.1.2.21 (1cf254d) Visual Studio extension to enable
development for "Xamarin.Android".
Xamarin.iOS 9.8.2.22 (f37444a) Visual Studio extension to enable
development for Xamarin.iOS.
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?
Yes, you can use Visual Studio for Android (native) using "vs-android".
Here are the steps to set it up:
Download the Android SDK here.
Download the Android NDK here.
Download Cygwin here.
Download the JDK here.
Download Visual Studio 2010, 2012 or 2013 here.
Download vs-android here.
Download Apache Ant here.
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
Download examples from here.
It works like a charm... and best so far to use.
Yes you can:
http://www.gavpugh.com/2011/02/04/vs-android-developing-for-android-in-visual-studio/
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
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.
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.
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.
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
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:
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.
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.
I know this q is quite old but it might me useful:
http://blogs.nvidia.com/2013/02/nvidia-introduces-nsight-tegra-to-assist-android-developers/
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.
You can use Visual Studio for Android Development. See a nice article on it here
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.
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
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
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!
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?
Yes, you can use Visual Studio for Android (native) using "vs-android".
Here are the steps to set it up:
Download the Android SDK here.
Download the Android NDK here.
Download Cygwin here.
Download the JDK here.
Download Visual Studio 2010, 2012 or 2013 here.
Download vs-android here.
Download Apache Ant here.
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
Download examples from here.
It works like a charm... and best so far to use.
Yes you can:
http://www.gavpugh.com/2011/02/04/vs-android-developing-for-android-in-visual-studio/
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
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.
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.
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.
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
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:
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.
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.
I know this q is quite old but it might me useful:
http://blogs.nvidia.com/2013/02/nvidia-introduces-nsight-tegra-to-assist-android-developers/
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.
You can use Visual Studio for Android Development. See a nice article on it here
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.
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
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
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!