Currently, MonoDroid (Mono for Android) doesn’t support native libraries (or any other Android resource type) in library projects (bug report). Fortunately, they support normal .NET assembly resources. This led me to write a workaround for this missing feature.
The Class ∞
Here’s the class that implements to loader.
How to use ∞
To use this class, you first need to create a directory structure for the native libraries, like this:
+- other ABIs you want to support
Now place the native libraries in the apropriate directories, for example:
| +- libsqlite.so
Then select “Embedded Resource” as Build Action in the file’s properties (Hotkey: F4).
Now use one of the
Load() methods to load the library. For example, if you have a type called
MyType in the project’s default namespace (specified in the project settings), you can use this call to load a library called
Note: If you renamed the directory “NativeLibs” from above, you can specify it as third parameter for