Currently, Xamarin for Android does not compile its own processor code. It creates .NET code that runs on the Mono virtual machine, which each compiled Xamarin application installs along with the rest of the application files. As far as I know, the only way a reasonable way to create native code for Android is to use the Android NDK ( http://developer.android.com/tools/sdk/ndk/index.html ) and write the code in C or C ++.
I did some unofficial tests, comparing Java code and analogs in C # compiled with Xamarin and Dot42, and native code for a real application (text processing). Basically, Xamarin's C # was 10-20% faster than Java or Dot42 in this particular application, while native code was about 5-6 times faster. Read more at:
Does anyone have tests (code and results) comparing the performance of Android applications written in Xamarin C # and Java?
Also, to protect my Java Java code from hacking, I use obfuscator DexGuard ( http://www.saikoa.com/dexguard ). However, I really don't know how much harder it is for good hackers to decompile and manipulate such confusing code. DexGuard will not protect .NET Xamarin code, of course, only Java code or other code compiled for the JVM. It will not even protect the Dot42 code, which compiles directly to the Dalvik VM p-code (all regular Android applications are launched on the virtual machine, the Java code is also βdecodedβ and converted to Dalvik code before it can run on Android).
Greg
gregko
source share