Does anyone have experience using Xamarin, as opposed to standard Android development in Eclipse?
I'm looking at the website and as a daily C# developer, this looks enticing. But I'm wondering what the limitations are as it seems somewhat too-good-to-be-true.
I couldn't get it to install properly when I tried it long ago.
They've changed licensing models fairly recently; you can deploy to the app store for free with a limit on app size (complexity). They also have a 30-day money-back guarantee -- seem to be really reaching out for mind share.
Obviously the important question is if it's worth the time to learn the abstraction layer!
APK size takes a small hit, and there's extra work to bring in Java libraries. That's all I've found. I've actually been using their guides when working on ordinary Java-based Android code; their docs are well-written and their SDK maps nearly 1:1 to Google's (helps here that Java and C# are fairly similar to a degree).
I do C# on my day job and I did take a stab a learning xamarin's android sdk but to be honest after spending 3 days learning it, poking around their samples, I felt like there was still a lot to learn. I ended up going the java route simply because there is more support for it from the community, many many open source controls/libs to begin with and stays up to date with Android releases.
I have for a couple of projects. Overall, I loved it. It allowed us to share code on iOS, Android and Windows Phone (though we wrote native UIs separately, in C#). Plus C# is a great language, and Visual Studio is a great IDE.
It's not perfect though:
- On Android, there's a limit to how many Java Native Interface objects you can have (40000 I believe). This sets a hard limit to how many object you can have that wrap Java objects, so for instance you can't have 40000 UI objects at the same time. It's possible to run into this problem, but you can work around it by working in Java for those parts.
- On iOS there are ways in which the Mono GC can free objects that are referenced by the native objects, but not by the C# code. For instance, you could pass a lambda to be called when a button gets clicked. This lambda (or something it references) gets freed, and when the button is clicked it tries to call C# code that's gone. This causes some really nasty bugs, and should IMO be considered a bug as it really breaks the expectations one has when coding in a managed language.
I've been bitten buy similar bugs in Mono, it's really frustrating. I do like the availability of Linq though.
Also coming from native iOS, debugging seems really clunky to me. It's very easy to reach a state where the IDE just goes "welp, I have no idea what's in scope right now".
As a C# developer, I had a hell of a time wrapping my head around Obj-C. I tried Titanium SDK hoping writing in JS would be more natural, but after several days I had a broken app that did nothing close to what I was trying to do.
When I saw & tried Xamarin, I had the exact thing I was trying to do in Titanium done within an hour, and that includes learning the SDK.
Highly, highly recommended. Also, when searching for help, be sure to search for MonoTouch as well as Xamarin. Finally, check out their IRC channel - some very helpful people there.
I have an Android app that lets developers discover Android libraries and run their demos. I have been thinking about adding some Xamarin samples but am unsure if it would be worth my time. I don't have a good feel for how many C# developers there are who want to write mobile apps.
Thanks! It all started with the thought, what would happen if native apps were as easy to try as website? DevAppsDirect is my MVP and I am just getting started.
12 comments
[ 2.9 ms ] story [ 46.5 ms ] threadI'm looking at the website and as a daily C# developer, this looks enticing. But I'm wondering what the limitations are as it seems somewhat too-good-to-be-true.
They've changed licensing models fairly recently; you can deploy to the app store for free with a limit on app size (complexity). They also have a 30-day money-back guarantee -- seem to be really reaching out for mind share.
Obviously the important question is if it's worth the time to learn the abstraction layer!
Edit: I'm sure they'll be swinging by once they are not so busy; check out the livestream of the conference going on right now: http://blog.xamarin.com/live-streaming-xamarin-evolve-2013/
It's not perfect though:
- On Android, there's a limit to how many Java Native Interface objects you can have (40000 I believe). This sets a hard limit to how many object you can have that wrap Java objects, so for instance you can't have 40000 UI objects at the same time. It's possible to run into this problem, but you can work around it by working in Java for those parts.
- On iOS there are ways in which the Mono GC can free objects that are referenced by the native objects, but not by the C# code. For instance, you could pass a lambda to be called when a button gets clicked. This lambda (or something it references) gets freed, and when the button is clicked it tries to call C# code that's gone. This causes some really nasty bugs, and should IMO be considered a bug as it really breaks the expectations one has when coding in a managed language.
Also coming from native iOS, debugging seems really clunky to me. It's very easy to reach a state where the IDE just goes "welp, I have no idea what's in scope right now".
When I saw & tried Xamarin, I had the exact thing I was trying to do in Titanium done within an hour, and that includes learning the SDK.
Highly, highly recommended. Also, when searching for help, be sure to search for MonoTouch as well as Xamarin. Finally, check out their IRC channel - some very helpful people there.