I'm familiar with C# projects, did cross platform development with Xamarin before.
I'm trying to reuse a .so library in a visual studio cross platform android project (Mono C#)? Is this possible?
Don't even know where to start. Any suggestions welcome.
Thanks in advance.
Yes, it is possible. With Xamarin.Android, you can bundle native libraries into the .apk
.
To actually call the code, you need to create a DllImport
function declaration for the existing code to invoke. Everything else is handled by the runtime for you.
[DllImport("yourlib.so")]
private static extern int someMethod();
Further reading: Using native libraries and Interop with Native Libraries
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.