I've recently chosen to learn C# and develop mobile apps using C# on Xamarin. Particularly for Windows Phone and Android development. I know that Windows Phone app development is mostly C#, and that Xamarin can compile native code for Android, but how does it compare to native development in Java? Will I be able to use EVERY or at least most (like 90%+) of the Android SDK and extensions using Xamarin?
-
You can probably spend some time in reading the documentation of Xamarin. Here is the link- http://xamarin.com/ . – Anukool May 17 '13 at 06:03
-
1Nothing can take place of native code :) – Ali Bahraminezhad May 17 '13 at 07:11
-
1Xamarin on their website: Xamarin.Android provides full access to standard Android APIs. – Frank Rem May 17 '13 at 10:27
-
What about the time it takes to compile and run an app? How does that compare between native and Xamarin? A slow compile-execute cycle can make a significant difference in development speed as it creates many interruptions in developer thinking and focus. Does using Xamarin affect compile time? How significantly? – Marchy Jul 31 '13 at 02:03
3 Answers
The main thing which I think there is to consider is your preferred programming language - which in your case is C# - and using that. The only thing that is of concern to me when building an app in C# as oppose to Java is their is not as many 3rd party references to use as there is with Java. You will find yourself downloading example files and reverse engineering them in order to learn how to do new features, you will have to search intellisence far more to find what something is using if you can only find a Java based example of something. One thing which you will find though is that it usually can just be the same method as what is in Java but the first letter being capitalized. LINQ is a major benefit I find in data manipulation which is not available in Java.
Good luck with whatever you choose, James

- 1
- 1

- 101
- 1
- 1
I did not do any stats or study of Xamarin C# coverage of Android Java API, but in my work, everything that I needed when porting code from Java to C# was there. Also, Xamarin says that for new Android SDK releases they usually have C# counterparts released within 24 hours. And, as @dotToString remarked, you can add Java jar libraries to Xamarin C# project and make calls to them if necessary.
Performance is another matter - I don't believe it runs natively on Android. Rather, Mono runtime is somehow interpreting the byte code. I did some comparison of Java vs. Xamarin C# code performance on real life code, see more at:
Greg
-
2The statement `Mono runtime is somehow interpreting the byte code` is not true. – Mark Lopez May 30 '14 at 05:58
-
1@MarkLopez - if you know better, please explain what exactly it does. Most probably "Just-in-Time" compilation of .NET pcode to native code, ahead of executing - what - the entire app, or a particular module, or one function at a time? – gregko May 30 '14 at 18:23
-
1There are actually two separate runtimes executing when running a monodroid app, a stripped version of the .NET's CLR and the native android Dalvik VM. The .NET runtime is hosted inside the mono runtime (Mono.Android.Platform.ApiLevel_XY.apk) that gets deployed with your monodroid app. It is this monodroid runtime that keeps the .NET CLR and Dalvik VM's in sync (object creation and destruction). – samus Jul 15 '14 at 12:47
you can use all of the android functionality and java library interop. also, you get the advantage of non windows specific .net including linq.

- 230
- 2
- 13