Java bindings
In the same manner as iOS, Xamarin has provided full support for calling into Java libraries from C# with Xamarin.Android
. The native Android SDKs function in this way and developers can leverage the Android Java Bindings
project to take advantage of other native Java libraries in C#. The main difference here is that not a lot has to be done by hand in comparison to Objective-C bindings. The Java syntax is very similar to that of C#, so many mappings are exactly one-to-one. In addition, Java has metadata information included with its libraries, which Xamarin uses to automatically generate the C# code required for calling into Java.
As an example, let's make a binding for the Android version of the Google Analytics SDK. Before we begin, download the SDK at https://developers.google.com/analytics/devguides/collection/android/v3/. At the time of writing, Google Analytics is being migrated to Google Play Services, but we will use this Java library as an exercise for creating Java...