|
|
|
|
|
by mwcampbell
3705 days ago
|
|
Now my only remaining qualm with Xamarin is this: Having two garbage-collected environments interacting within the same program, as is the case with Xamarin on Android, just seems pathologically complex. Does anyone have enough experience with Xamarin on Android to know if this is ever a problem in practice? Edit: I wonder if the Xamarin.Android developers ever considered compiling CIL to JVM bytecode (which would then be compiled to Dex bytecode), then reimplementing mscorlib on top of the Java standard libraries. So basically, IKVM.NET in reverse. Then there'd be no bridging between two environments. |
|
With Android the most common mistake is cross-heap references, putting a large C# array into a java arrayadapter for example will result in objects that live in both worlds which makes it expensive for Java to see the C# object and C# to see the Java object. The objects are effectively being mirrored, the solution is to use C# all the way down. Where the object was created defines ownership, for example ArrayAdapter containing C# objects means owned by Java with overhead for Java to bridge the C# objects.