Is there any way to bind native libraries like in Xamarin? I have tried to do some native implementations in the new .NET Maui and haven't had success on it. I would really appreciate if someone has some information about it.
Create bindings to native libraries .net Maui
9.4k Views Asked by jaesjulio At
2
There are 2 best solutions below
2

Yes, native library bindings are done the same way as in Xamarin, there are two new project templates "Android Java Library Binding" and "iOS Binding Library" just add them and follow regular Xamarin documentation in order to configure it:
- https://learn.microsoft.com/en-us/xamarin/ios/platform/binding-objective-c/
- https://learn.microsoft.com/en-us/xamarin/android/platform/binding-java-library/
For android you can also check this git repo - https://github.com/Bohdandn/MAUI.WebRTC.Demo, unfortunately iOS doesn't compile there.
For android jar files, I'm using .NET MAUI class library
Add this "ItemGroup" to your project, if you can create a wrap class like