18

I am attempting to learn more about mobile/tablet development and, as a .NET developer, I am naturally drawn to Mono. But I am confused--I thought that Mono was free and open source; however, all signs seem to point to Mono being a "pay-to-play" deal (https://store.xamarin.com/).

Can someone please help me understand which is the correct answer?

Thanks!

Matt

competent_tech
  • 44,465
  • 11
  • 90
  • 113
Matt Cashatt
  • 23,490
  • 28
  • 78
  • 111

5 Answers5

36

Update (2016/03/31)

History answer

First let's clear up the Mono case :-)

Mono is free as in free speech, not free beer. You can get it for free (i.e. without paying) as it is available under open source licenses that allow this. But you could still pay for it too (e.g. people did pay for some versions of Mono in Novell's days). Also some people cannot use Mono under the free open source licenses (e.g. as a game engine where the source is not available...). In such cases a commercial license, from the copyright holders, is needed.

Mono for Android is a commercial product based on Mono and sold by Xamarin (who has the rights to license Mono). It re-use a lot of what Mono has achieved and also brings a lot more features to allow .NET developers to use their skills on the Android platforms.

Finally evaluation versions of Mono for Android are free and fully functional when used with the Android emulator (not with devices). So you can still try, learn and enjoy Mono and Mono for Android without paying a dime to Xamarin :-)

note: the same applies for MonoTouch which allows you to build .NET-based iPhone/iPad (iOS) applications from an Mac OSX computer.

Disclaimer: I work for Xamarin

poupou
  • 43,413
  • 6
  • 77
  • 174
  • The libraries are available under one of LGPL v2 or MIT/X11, so proprietary game engines probably *could* link to it. They just might not feel comfortable doing so, because of certain provisions around reverse engineering and similar. – Matthew Flaschen Oct 29 '11 at 00:39
  • @MatthewFlaschen yes they *can*, the license offer ways (e.g. re-linking) to enable almost anything as long as you comply with a few basic rules - but there's an alternative if not – poupou Oct 29 '11 at 15:30
  • Don't forget Unity, for android/ios much of the engine is mono. – IanNorton Aug 24 '12 at 12:48
  • 1
    What's the status of the vanilla, open source Mono on Android/iOS? How many changes are required to get it to run a non-UI piece of C# code on Android? Obviously, the UI bindings don't exist in the open source version, but what else is missing? – Jonathan Baldwin Jan 17 '14 at 02:00
  • 1
    but if you want to just execute some .net code in android or ios, without native stuff. Something that could be compiled as a Portable Class Library if necessary. Do you still need Xamarin for this? Suppose you have .net backend code and want to make an html based UI. In this case you just need the standard mono libs, which are free basically, right? Not sure exactly how would all this link together in a project but my question stands. – Radu Simionescu Oct 29 '15 at 09:19
  • @RaduSimionescu if you want C# on the server-side only (e.g. geenrated HTML that is sent to the devices) then you're fine. OTOH if you want to execute .NET code on the device then you still need a runtime (not just libraries) which brings you back to the LGPL and the AOT compiler (JIT is not allowed on devices) which is not open source. – poupou Oct 29 '15 at 13:57
17

As a long-time .Net developer (starting with 1.0), I can tell you that if you are anything other than a hobbyist, any money you spend on MonoTouch and MonoDroid will pay huge dividends in the very short term.

There is a certainly a learning curve for the UI and the third-party control environment isn't anywhere near as robust as it is for the Windows platforms, but the ability to program against the .Net framework (even if the language is C#) is an indescribable advantage and well worth every penny spent with Xamarin.

We were able to port a 500,000 line VB.Net application written for the Tablet OS and PocketPC to the iPad in less than 3 months, including local database support, web services interaction, etc. And it should take us less than another month to create the UI for Android now that we have a common services layer. At that point, we will have an application that will have similar functionality across iOS, Android, Windows desktop, Windows tablet, and Windows Phone. I certainly can't do that with the tens of thousands of dollars that I spend per year in the Microsoft ecosystem.

competent_tech
  • 44,465
  • 11
  • 90
  • 113
  • 4
    This is not answer to the question. "It is not free" would have sufficed. It is useful to hear your strong recommendation though. – rpattabi Mar 23 '13 at 11:47
  • @Ragu: I'm sorry, but you are incorrect; "it is not free" would not help the OP "understand which is the correct answer" as they asked in the question. All it would have done was state what the correct answer was without helping them understand it as they requested. – competent_tech Mar 23 '13 at 18:21
  • I agree that 'It is not free' would not be a complete answer. But this answer is more of a recommendation about why it is a good idea to pay than clarifying the business model of MonoTouch/MonoDroid. May be it is just about rephrasing. – rpattabi Mar 24 '13 at 03:54
  • If I want to develop on iOS, Android & Windows Phone that'll cost me $3000 - will that really pay dividends? – noelicus Dec 05 '13 at 11:00
  • @noelicus: only you can answer that. For us, $3000 is about 20 developer hours, so the dividends were enormous as compared to writing two different native applications from the ground up and maintaining two completely separate code bases. If you have more time than money and are not charging for your app, then the answer could be completely different for you. – competent_tech Dec 05 '13 at 11:16
  • @noelicus xamarin is not necessary for windows phone so... $2000. Also you are talking about the Business edition. You can go with indie if the mobile team is smaller and it will cost you only like 700$ per year. The VS studio integration, when it comes to building for IOS, is kind of useless - you need a mac anyway. If you insist on developing in visual studio for ios you will need to work on the mac and windows machine at the same time - I suggest Synergy, but the overall flow is not as smooth. – Radu Simionescu Oct 29 '15 at 09:29
11

Old post, but poupou's answer needs some clarification and some additional information.

First of all, since Poupou's posting, Xamarin has added a new Community Edition license to the entire Mono/Android/iOS stack that allows for closed source distribution of apps, but this license is restricted to how large the binaries can be. In practice, even some Hello World applications exceed the community edition binary size limits, so in my opinion this is not a real option by any practical definition.

That being said, the core Mono runtime and runtime libraries are licensed under LGPL. This makes it difficult to release closed-source software in an app store using the mono runtime without purchasing a commercial license from Xamarin, but not impossible. One option that the LGPL allows, according to my understanding, is to provide the object files for your app. This would allow a user to re-link your app's object files to a different version of the mono runtime and then install that relinked app onto their device. They would still have access to the object files, but you could still keep your source closed if you wished. I'm not a lawyer, but I think you may be able to charge for these object files and distribute them by request only.

If you want to release an open source application using mono, you would be well positioned to do so because you can of course release not just the object code but the full source of your app, allowing users to relink mono into their own version of your app, and thus fulfilling the requirements of the LGPL.

Now, here's the problem. While what I said above is true, it ONLY applies to the core mono runtime. That's because the core mono runtime has an open source license. You might be surprised to know that none of the platform specific BINDINGS, which are the libraries and developer tools that Xamarin provides to hook up your .net mono code to, say, the platform UI/system libraries of android and iOS, are open source at all. So, Mono for Android and MonoTouch (and monomac?) are neither free as in free speech nor free as in free beer. They are both 100% commercial products. Now, I'm told you can request an open source compatible license privately, but your open source project must be pre-approved, which means you will not be able to take advantage of the object code option for a closed source project, and I don't know what kind of restrictions Xamarin would place on such a license (I suspect similar restrictions to the community edition).

EDIT: Correction to the above - Xamarin won't give you an open source compatible license for an open source project. Instead, they will give you (as in, the developer wanting to release a build of an open source app on one of the app stores), a free full Xamarin license if they can verify that your app is legitimately open source. This is still the commercial license (for one developer), and not an open source compatible license, so this license does not apply to any other developers who download the code for your project and build it. They will need to purchase their own Xamarin license to publish their version of the open source app.

What this means is that, the only way to take advantage of the LGPL object code option for closed source distribution (or, indeed, to release an LGPL compatible open source app without Xamarin's permission), you would need to write all of your own platform bindings to make it possible for your app to interact with the system or UI in any meaningful way. Koushik Dutta, from ClockworkMod, originally started such a project, at least for the android bindings, prior to Xamarin's release of Mono for Android. He abandoned the project after Xamarin's release, but the code is still available here: https://github.com/koush/androidmono

If one were to create a set of android/iOS bindings for Mono and release them under a permissive open source license like MIT/X11, then apps could bypass Xamarin and release apps under the object file option for LGPL compliance (or just release the code, if it's an open source app).

Going one GIANT step further - if you look at the core mono licensing breakdown, you'll notice that only the core mono runtime and its libraries are licensed under LGPL. Almost all of the class libraries are already using a permissive license like MIT/X11 or else some form of Apache or MS-PL. That means that if, hypothetically, in addition to creating some permissive open source bindings for android/iOS, someone were to start from scratch and rewrite the core mono runtime and runtime libraries (all the LGPL'ed parts of mono) using a more permissive license, then that hypothetical version of mono (I call it "MonoLibre" when I daydream about it) could be embedded in a closed source app, for free, without releasing object files, open sourcing your app, paying Xamarin anything, or having to ask Xamarin for permission to distribute your open source app. Xamarin could continue to sell the "commercialized" mono runtime, but MonoLibre could continue to use all the same class libraries and even the same compiler.

Jeremy Bell
  • 5,253
  • 5
  • 41
  • 63
  • >"Xamarin won't give you an open source compatible license for an open source project. Instead, they will give you (as in, the developer wanting to release a build of an open source app on one of the app stores), a free full Xamarin license if they can verify that your app is legitimately open source." Can you, please, tell more about it? Proof link, maybe? I'm interested in it. – Display Name Aug 17 '13 at 11:36
  • I had asked the question on the mono-dev mailing list, and got the answer there. I don't have a direct link, but you can either search the archives or email someone on the team directly. The latter is advisable - since this isn't a documented licensing arrangement, their policies may have changed since then. – Jeremy Bell Aug 19 '13 at 12:46
  • A lot of guys here don't seem to understand the LGPL and linking, probably because guys commenting here are from a .net background. I've developed in C++ for some time, I can tell you that you're totally safe with LGPL if the LGPL applies to a dynamically linked assembly. I assume this is what they're licensing, the runtime as a DLL (.so on nix systems). As long as someone can drop in their own compiled version and it still works, you're in the clear. Of course, IANAL. –  Dec 19 '14 at 10:45
  • @Technik Empire: I understand the LGPL requirements and verified with both Xamarin and the free software foundation. The critical piece that is missing is "as long as someone can drop in their own compiled version and it still works". This is not possible on iOS, most console app distribution portals, or on android for non – Jeremy Bell Dec 19 '14 at 23:34
  • ... or on android for many non-rooted phones. I would say Android is probably the most debatable of the modern platforms, but given the signing requirements you may be out of luck for commercial software. – Jeremy Bell Dec 19 '14 at 23:44
  • @JeremyBell you're right, that is an issue. I never even thought of that. But, at least on android, you could theoretically just unzip, drop in replacement, then rezip. I know, it's flaky. I guess it's a good thing that microsoft is open sourcing ryujit and .net native, so on and so forth. I sincerely hope the community runs away with a truly free and open source .net platform. –  Dec 21 '14 at 02:10
  • I hope so. However, keep in mind that CoreCLR/RyuJIT won't have ARM support in the first release of the source. It probably will eventually (the WinRT/.net native build has it), but it may take some time. Plus a LOT of work went into the mono android port beyond just compiling it with the NDK. – Jeremy Bell Dec 21 '14 at 14:45
6

Mono itself is free. That doesn't mean everything written with mono is free. As is the case for mono for android. Somebody took the time to write software that makes mono work with android. Just because it's written in mono doesn't mean they have to share it for free. The only thing they'd have to share is any changes the made to mono itself. Just because android is free and open, doesn't mean I can't make applications and require people purchase them in order to use them.

Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102
  • Well, you can't force people to buy them. But you can prohibit from them using them unless they pay. – Matthew Flaschen Oct 29 '11 at 00:16
  • @MatthewFlaschen Fair enough. Corrected. – Kurtis Nusbaum Oct 29 '11 at 00:17
  • "The only thing they'd have to share is any changes the made to mono itself" False, in this case. Xamarain, the authors of MonoTouch and Mono for Android hold copyright for Mono. They don't have to follow the LGPL, as they OWN it, and thus can do whatever they please with it. If someone else wanted to do the same thing, they'd either have to follow the LGPL - in which case they'd have to license changes to Mono in an LGPL-compliant manner - or negotiate (ie. pay for) a different license with Xamarin. – Jonathan Baldwin Jan 17 '14 at 01:45
  • Xamarain owns Mono? I didn't know that. – Kurtis Nusbaum Jan 21 '14 at 19:22
1

It's been a while since this questions was first asked but I did come across a completely open source option called Monocross http://monocross.net/

Haven't used it so I don't know how good it is.

Automate
  • 183
  • 1
  • 9
  • I don't think this answers the question that the OP was asking. – valdetero Mar 09 '15 at 19:54
  • Monocross allows you to make MVC applications for various platforms and utilizes mono. Basically if you want to use it to make an app for Android or iOS, same limitations apply. Monocross itself might be open source and all, but you still need Xamarin.Android. – jahu Mar 23 '15 at 18:46
  • I don't really see the point of monocross... it still requires Xamarin licenses for the platforms you are targeting... – Radu Simionescu Oct 29 '15 at 09:47