Use Mono for android on with Mono - windows

It looks really easy to switch MonoDevelop's compiler to Mono tools instead of .NET – you just need to pick a different framework under settings of the IDE.
However, after switching to Mono and getting the project compiling by Mono tools, Mono for android no longer seems to be an available framework (i.e. the reference to it in the Android project turns red). Obviously, the build fails with tons of errors like Android.XXX.YYY is not a class or namespace name, etc.
Is there a way to install Mono for android on a Windows machine so that it is available to Mono tools and usable from Monodevelop running on Mono?

No. Mono for Android uses the MSBuild build system, and installs custom build tasks and frameworks into the MSBuild extension directories. Mono's implementation of MSBuild (xbuild) has separate extension directories. It might be possible to copy the targets and extensions across but you'd probably run into other issues, as it's completely untested.
In general on Windows I'd recommend using the MS/.NET toolchain in MonoDevelop unless you have a really good reason to use the Mono toolchain. Note that you can run with Mono even if you compile with .NET, using the Run->Run with... menu.

Related

I have a small Vulkan project in VS C++ that runs on Windows. Can I make it run on Android in the same solution, supporting both Windows and Android?

I want my project to run on windows, and I want the ability to also run on Android. Basically one project that can run on two (or more) targets.
If not in VS, is there another way to accomplish this?
If you want a project that can be built both for Windows and Android, I suggest you look into creating a CMake project. CMake can be integrated both with VS and with Android Studio.
However, if you haven't done any Android NDK development, I suggest you start out with some Android-only examples first.
As an example, I work with a fork of Sascha Willem's Vulkan examples. In my fork I have a cmake file that is used both to generate Visual Studio projects, and also referenced by the Gradle build file for the Android build.
EDIT: removed incorrect statement about VS not supporting Android at all.

Why would the following errors occur in Xamarin Studio on OS X but not in Visual Studio?

I'm trying to understand why I'm getting the following errors when running tests in Xamarin Studio 5.9.1 (build 3) on OS X.
System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
System.TypeLoadException : A type load exception has occurred.
All projects build successfully and the same tests run just fine in Visual Studio on Windows using the same solution.
I am seeing a warning when building the test project on OS X, despite having already installed and added the reference.
All projects referencing MyProject.fsproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
I still don't know why Xamarin behaves differently than Visual Studio, but the root cause was that the test project was targeting .Net 4.5 whereas the main project was targeting .Net 4.0
Thanks to #7sharp9 for the help.
Different platforms (Android, iOS, Desktop) have different System.Net.Http.dll binaries - compiled from the same source, but each version references the mscorlib.dll (and other base-class libraries) from the platform it was built against.
This is not a problem when you use it in an application - Xamarin Studio will automatically pick the right version for you - but you can't use it in a Portable Class Library.
Microsoft initially implemented HttpClient as part of .NET 4.5, but then released a portable version of it (with a Windows-only license). If I understand this correctly, then that's mostly the same API as in .NET 4.5 plus a few minor additions (I think they added gzip compression, which Mono's version currently doesn't).
For Xamarin / Mono, all we need to do to create an open-source version of this library is to take our existing sources and compile them against the portable profile. I haven't tried this yet, but this could be as easy as editing the .csproj file and replacing the .
Also would suggest that you install HttpClient NuGet package
System.Net.Http.HttpClient is available directly from the latest version of Xamarin.
Simply check for updates from Xamarin Studio ;-)

Unit Testing Monotouch under Visual Studio

I have a Monotouch iOS application that I'm writing in Visual Studio using Xamarin's new Visual-Studio plug-in.
I would like a way to execute my Unit tests from within Visual Studio (e.g. with the Resharper runner).
I don't much care which unit testing tool I used (they're currently written as nUnit tests).
I know Xamarin supports Touch.Unit which will allow me to run on the device or simulator, but this is too long of a cycle-time, I need it to run on my windows machine.
I tried to use NUnitLite, but this still has the problem of not being able to run on the windows machine.
I also attempted to use the Visual Studio Solution configurations, which should, theoretically allow me to choose a different build configuration in the drop-down to switch between windows (for my cross-platform core library + its tests) and Monotouch (for the IOS UI app, cross-platform library, and IOS tests), but in this, the project references didn't automatically switch to the other framework, or I just messed up how to properly setup a secondary build configuration.
Finally, using two different solution files and separate sets of project files is not ideal because one needs to switch and also keep the clone project's files in sync.
Any ideas on the best way to accomplish easy, fast, unit testing?
The way I've made this work in the past is:
Have all your core code in a regular .Net 4 library. This library
has no dependencies on iOS or Android.
Write tests against the core library in another .Net 4 project, using NUnit Lite syntax in your asserts. Use ReSharper to run them all you like.
If you wish, setup an iOS project to run the tests in a simulator - link-in all the files for the tests
On iOS or Android, you will need to link-in the files from the core project.
If you have any platform-specific code in your tests, you won't be able to run them with ReSharper.
If you want to see an example, we took this same approach with Xamarin's Field Service app.

Qt Creator vs Xcode for Qt development on the Mac

I'm about to start a Qt project on the Mac and I'm not sure which IDE to choose between:
Qt Creator
Xcode
Which are the advantages/disadvantages of these two IDEs for Qt development on the Mac?
Personally I'm using QtCreator in order to have the same on all platforms. The main advantage I give to it is that it have been developed for Qt.
The main advantage I give to XCode is its integration to MacOSX.
Now for you it depends:
If you always use XCode, You should continue using it for Qt to keep your marks
If you always use QtCreator, you should continue using it
If you start developing on MacOSX (or you've never used XCode) you should use QtCreator
Then my advice is: use the IDE you prefer to use
Qt Creator has much better integration with Qt in code editing, UI designing, and debugging. And it's the same across platform.
My issue with Creator on the Mac is it's debugging facility is not on a par with other platform. The python script-able debugger is not as functioning as, say Windows version of Creator. This is not Qt/Nokia's fault since the gcc/gdb on Mac are versions behind. Apple switched its focus to LLVM and left gcc tool chain, eh, to its natural death on the platform.
I actually do much of my developing on a Windows VM. Only switch to Mac for building and debugging something that's only Mac-specific.
Both options have issues. Qt Creator has problems with projects that have complicated project hierarchies (complicated in terms of folder structure.)
With Xcode, there are issues if you want to have some objective-c source in your project and if you want to be able to step into Qt source while debugging.
Most of my development is done on the Mac using Xcode and BBEdit. I switch over to Developer Studio on Windows for testing or if I need to be able to step into Qt while debugging.
Given the amount of time we all spend working working in these environments, you should try both and use what suits you best.
You also need to consider eclipse. I have spent the last week using Qt Creator and being a long-time eclipse user (for both Java and C++) I find it inferior. Once (if) Xcode 4 support is added to Qt, this might change, but at the moment my vote goes with eclipse even without the 'Qt Integration' available (i.e. just using the 'C++ Makefile project with existing sources').

Xcode programming

I wrote my programs in Visual Studio. now i have an mac and i want to program there like visual-studio. but there are differences between them. Is there any solution that i can write a code in Xcode that it is compatible in Visual Studio and works without any errors?
Is there any solution that i can write
a code in Xcode that it is compatible
in visual-Studio and works without any
errors?
Write standard portable source code. Xcode uses the GCC toolchain, VS uses MS's cl compiler. They are different. Xcode does have the notion of projects and solutions and allows configurations. However, they are a bit complicated (so beware). Also, the Xcode debugger is buggy and the editor is not as feature-rich as the VS2005/VS2008 IDE.
You can build Cocoa/Carbon based applications on Xcode but these won't compile/run on VS. Similarly, you can build Win32 applications on VS which won't run/compile on Xcode.
All in all, Xcode is your best shot at an IDE if you're not a vim/emacs fan.
You can easily write portable low level code in C/C++, but any GUI code or code which calls the OS will be non-portable.
Java would be also a good solution for platform independency. NetBeans would be my choice.
Would in theory be possible to have a vs template so you go project structure and intellisense then when you build have a build script export to the mac or source repository then build on mac
Either way Xcode needs to be run on a Mac.
You can use Mono and MonoDevelop, then the programs you create on Mac can run on Windows also. I use Visual Studio on my job, but my spare time I like to play around with mono on my mac. http://www.mono-project.com/

Resources