Android apps run within the Dalvik Virtual Machine (Dalvik VM), which is somewhat similar to a Java VM, but optimized for devices with limited resources. As we discussed in Chapter 1, Xamarin and Mono – a Pathway to the Unnatural, Xamarin products are based on the Mono platform that has its own VM called the Common Language Runtime (CLR). The key question to ask here is, "In which environment does a Xamarin.Android app run?" The answer is both. If you take a look at the next diagram, you will see for yourself how these two runtimes coexist:
Both environments seem quite different from each other, so how does an app run in both? Xamarin.Android's power is achieved through a concept called peer objects and a Java framework called Java Native Interface (JNI).