Xamarin: using your own library

1) If there are iOS and Android base libraries, what would be a suitable, effective and easy step to use the library to develop a cross-platform application? Binding Android or iOS library? If we bind the native Android library, can we use this linked library in the Xamarin.iOS application and vice versa?

2) If there is a C ++ library, is it possible to use this library to develop a cross-platform application?

Thanks in advance!

(Just new to Xamarin, so excuses if question seems inappropriate)

+6
source share
1 answer
  • The native iOS and Android libraries are usually completely different (iOS libraries are usually written to Objective-C and Android libraries in Java), and because of this, the bindings for each will be different. Even if the API was identical, the distinction between Objective-C and Java is enough to make the bindings different too.

  • Yes, you can use C ++ in iOS and Android projects, but the mechanism is different. There are several options here:

    • Use a tool like SWIG to create managed bindings for the C ++ library. This is also an interesting read.

    • Create a C library that wraps the C ++ library, and then use the standard P / Invoke mechanism, available in managed code, to interact with the C library.

+2
source

All Articles